User Tools

Site Tools


projects:jansonntag

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
projects:jansonntag [2021/02/07 10:47]
jan
projects:jansonntag [2021/03/13 14:03] (current)
jan
Line 1: Line 1:
-**Analog Keyboard Project**+====== Analog Keyboard Project ====== 
  
 **The plan:** **The plan:**
Line 12: Line 13:
  
 **Concept:**\\  **Concept:**\\ 
-Use a circuit board coil to measure how far the key is pressed by measuring the inductance of the underlying coil. This should work because the Cherry MX has a metal spring inside. Also, it has been done before but without good documentation. [[https://imgur.com/gallery/ImrH7nO|See here]]\\  +Use a circuit board coil to measure how far the key is pressed by measuring the inductance of the underlying coil. This should work because the Cherry MX has a metal spring inside. Also, it has been done before but without good documentation. [[https://imgur.com/gallery/ImrH7nO|See here]]\\
-**Attempt 1**\\  +
-I made some rough sketches in Photoshop CS2 (yes Coil CB Designs in Photoshop). It worked out quite "good", but it lacks some precision. I will have to try out something different (maybe Illustrator would work :thinking: out for this). Here are the three files I came up with. One for the traces (eg Coil and connection pads), one for the holes (the Cherry Key needs some holes in the CB, this also limits the size of the coil btw), and one for the outline (the cutout of the CB):\\  +
-{{:projects:versuch1_traces.png?200|}} {{:projects:versuch1_holes.png?200|}}{{:projects:versuch1_outline.png?200|}}\\  +
-And also for people interested in the PSD-File: \\  +
-The coil design you see is a special one and named planar coils. It is commonly used in microactuators or PCB motors. But I want to test if it works for my use-case also. The big plus point for this: I don't have to look into making a double-sided CB. Not so good is the number of windings I can do but maybe it will work out fine. It's still an experiment none the less.  If you want to read more about this type of coils have a look into this: [[https://www.sciencedirect.com/science/article/pii/S1877050918310135|Electromagnetic Microactuators using Non-spiral Planar Micro coils for Robotic Applications]]\\  +
-The pictures were converted for the milling machine with the help of [[http://fabmodules.org/|fabmodules]] to the needed G-Code (.nc files).\\  +
-The traces-picture needed the process "PCB traces (1/64)". I just upped the cut speed to 10 mm/s and the tool diameter to 0.1 mm. The hole and outline-pictures needed the process "PCB outline (1/32)". The cut speed was upped to 10 mm/s, the plunge speed to 5 mm/s, the jog height down to 2 mm, cut depth to 1.6mm, and the tool diameter up to 0.5mm. The traces (especially) on the left side are very fine. It was very hard to get these at least half-decently good into the CB with the CB-Milling Machine. Ferdi and I got it then after 3 passes for the traces.\\  +
- +
-{{:projects:firstattempt.mp4?400|}}\\  +
- +
-As you may see we already did one pass before. The inconsistent color on the right coil shows that the bed of the machine is not perfectly level. From the first pass to the last pass, we were going down 0.05mm each pass. Here are the results:\\  +
-{{:projects:20200605_142837.jpg?600|}}\\  +
-The left coil is designed with finner but therefore more windings. The problem right now there seemed to be a bit too far apart. The milling machine did two runs between two windings. Maybe I could get it to work with just one pass so that they be even narrower or I would have to make them even further apart. But with a multimeter, I can confirm that there is at least a connection between both pads.\\  +
-{{uploads:8be441acc8497597ed18a3de0ed14882:20200605_142842.jpg|20200605_142842}}\\  +
-The right coil looks a bit better. But it also has fewer coil turns and they are a bit more spaced apart. The spacing between the windings seems to be a bit more consistent. Also, there is some copper left between the windings. Hopefully, this can be scraped away later with a knife.\\  +
-{{:projects:20200605_144131.jpg?400|}}\\  +
- +
-The holes came out well, at least their placing. Because the holes are not 100% straight and the middle one was a bit too small it did not fit well. This is mostly a problem in the middle one. This can be fixed in the next attempt.\\  +
-After that, I just soldered some jumper cables to the pads. Now I have to make a circuit so I can measure the inductance of the coils.  +
-{{:projects:20200607_183852.jpg?400|}}\\  +
-I tested out [[http://www.electronoobs.com/eng_arduino_tut10_3.php|this circuit]] by electronoobs, but it was not working well and it is also not suitable for this kind of coils. The printed/milled out coils are just too small for this circuit. Also, the used wires were too long and made a lot of interference. As I found out I need a much higher frequency to measure the inductance of these coils (around 6 Mhz). Such a high frequency cannot be produced by an Arduino unfortunately. [[https://soldernerd.com/inductance-meter/|This project]] is somewhat close to what I need but I have to do more research on this. Until I make a new circuit I cannot test the coils if they even work. +
- +
-**Attempt 2** +
- +
-So today I made a first rough sketch of what I had in mind. I really don't know if this would even work but this is my let's say Version 0.1.0:  +
- +
-{{:projects:firstideagood.png?400|}} +
- +
-I still didn´t test the new design but I found some other cool links +
- +
-  * https://electronics-diy.com/lc_meter.php +
-  * https://de.steelseries.com/gaming-keyboards/apex-pro +
-  * https://www.mev-elektronik.com/position-sensors-en/cam-sensor-rotary-type-6.html (The rotary design could be adopted) +
-  * https://www.mev-elektronik.com/Inductive-Position-Sensors.html +
- +
-**Attempt 3** +
- +
-After a while of looking at it, this seems far too complicated! There have to be simpler, cheaper, and more accurate solutions. I started searching for some ICs that maybe can do the trick but didn't found any good other than the links I posted above. But then Henrik found something great: The LDC1314 +
- +
-It is really good...I think. +
- +
-https://www.ti.com/lit/ds/symlink/ldc1314.pdf?ts=1594984537226 +
- +
-And ti even has an informative paper about PCB-Coils and LDC Sensor Design: https://www.ti.com/lit/an/snoa930b/snoa930b.pdf?ts=1594984818448 Important Pages: +
- +
-  * 7-9 +
- +
-On it goes with designing a real PCB. The Milled CBs are just not accurate enough for this kinda task. Some cheap prototype PCBs from China have to be used. Maybe I should think about selling these when I´m finished. Getting kinda pricy. ( :thinking: about Best Idea Cup (maybe not because it's not my idea)) +
- +
-{{:projects:anmerkung_2020-07-20_231548.png?400|}}\\  +
- +
-This is the current state. The PCB Coil is still missing. Have to do some calculations. Btw I´m now using Eagle! This is so much more comfortable than EasyEDA and KiCad! Btw: When this works, I will try this for a NUM-Block: https://www.ti.com/lit/ug/tidu954a/tidu954a.pdf?ts=1595620233337&ref_url=https%253A%252F%252Fwww.google.com%252F +
- +
-I found even more detailed pictures on the website of the "mother-company" of knops: https://alltrons.com/analog-keyboard-technology/ +
- +
-{{https://www.mememaker.net/api/bucket?path=static/img/memes/full/2017/Jun/4/4/im-about-to-destroy-this-mans-whole-career.jpg}}They are only mentioning copyright for 2018 and 2019. The company seems to be very inactive. +
- +
-Now with a 5V to 3.3V converter with ultra-low noise output. With all these bypass capacitors this has to be a super-duper ultra-low noise circuit.  +
- +
-{{:projects:anmerkung_2020-07-28_214913.png?400|}} +
- +
-Just the Coils are missing (not that much work just a symbol with another capacitor in parallel). Then I have to design the PCB. I think I decided on making the prototype a 4 layer one. JLCs capabilities are just so much better with these then. +
- +
-Had to take a break from this project. Now one and half months later I´m on it again. So nothing has changed. Still planning the 4-layer-PCB tho. The LDC1314 is a 4 channel chip, so I want to try out basically 4 different designs for PCB-Coils to evaluate which one is the best. Designs I want to try out (subject to change): +
- +
-  - 2 Real Layers on an otherwise 4 Layer PCB with a big via +
-  - 2 Real Layers on an otherwise 4 Layer PCB without a big via +
-  - 4 Real Layers on a 4 Layer PCB without a big via (because two are needed) +
-  - 2 Real Layers on an otherwise 4 Layer PCB with a big via but with JLCs Capabilities for 2 Layer PCB +
- +
-Here an example of design number 1 I made:  +
- +
-{{:projects:screenshot_2020-10-05_160226.png?400|}} +
- +
-For the coils, I made some calculations, because there is a correlation between the frequency that is used and the needed capacitor in front of the coil. \\  +
- +
-{{:projects:screenshot_2020-11-27_152146.png?400|}}\\  +
- +
-Because of this I now know that I need the LTC6900 to output a frequency of roughly 6Mhz. Therefore I need to calculate the resistance of the resistor at the Set-Pin of the LTC6900. I calculated with this formula:  +
-{{:projects:screenshot_2020-11-29_171838.png?200|}} +
- N = 1 +
- +
-So I need a 33.3kOhm resistor in front of the LTC6900 Set-Pin. +
- +
-And here is my first "final" schematic then:\\  +
-{{:projects:screenshot_2020-11-29_173745.png?400|}}\\  +
-Btw I don't know how to make PCB-board-layouts. This can only get better.\\  +
- +
-After I tried some designs I guess the only real option that is possible with the keys is Option Number 1 (2 Real Layers on an otherwise 4 Layer PCB with a big via). So I modified the Cherry Key Footprint to my likings and designed my first real PCB (kudos to Henrik). Here is V1 of the PCB:\\  +
- +
-{{:projects:screenshot_2020-12-05_174147.png?400|}}\\  +
- +
-I had some room left and also added a part where I can plug in an Arduino Pro Micro and connect to the real MX Key Pins.\\  +
-So some time has past and I have waited nearly a month for my PCBs to arrive (because of customs). But they turned out great:\\ +
-{{:projects:20210206_192939.jpg?200|}} +
-{{:projects:20210206_192856.jpg?200|}}+
 \\ \\
-With a cheap microscope of eBay, started inspecting the PCB. It´s stunning how tiny the coil traces are! With "cheap" soldering station (with hot air) of eBay (eBay FTW ;D ) I made some test solders on scrap PCB from the IoT-Lab with some very old soldering paste (also from the IoT-Lab)The paste wasn'really in a good condition, but mixed with Flux it worked great for meWhen kinda got the hang of soldering with hot air I started soldering the real PCB. So the first time hot air soldering with the first time QFN Soldering worked great. Not perfect, but the circuit works. Here are some close-ups:\\ +[[JanSonntag:attempt1|Attempt 1]]\\ 
-{{:projects:win_20210112_18_09_11_pro.jpg?200|}} +tried using milled single-sided circuit board and simple circuit by electronoobs for measuring the inductance of the milled coilsDidn'work thoBut learned some stuff about PCB coils and especially single-sided coils.
-{{:projects:win_20210112_18_19_09_pro.jpg?200|}}+
 \\ \\
-And some more shots of the finished PCB:\\ 
-{{:projects:20210206_193120.jpg?200|}} 
-{{:projects:20210206_193108.jpg?200|}} 
 \\ \\
-With the circuit finished I started working on the test code. My goal was to read out one of the coils and display the value on the serial plotter of the Arduino IDE. So more or less a proof of concept. +[[JanSonntag:attempt2|Attempt 2]]\\ 
-With the help of Google, I found a project by the GitHub-User dfieschko, in which he made an I2C library for the Teensy and the LDC1312/14 (Can be found here: [[https://github.com/dfieschko/LDC1312-Arduino|LDC1312-Arduino]]). Because the library wasn't compatible with the Pro Micro forked it and made my own version. The new library can be found here: [[https://github.com/SirSundays/LDC1312-Arduino|LDC1312-Arduino]]. I didn'test all the functions but the ones I needed worked perfectly. I then started writing some code. And here is what came out: +Here tried designing a new circuit for the milled coils. I didn'even bother trying it out because it seems too complicatedBut therefore got into circuit-design
-<file ino ldc1314-test.ino> +\\ 
-#include <ldc1312_lib.h> +\\ 
-#include <Wire.h> +[[JanSonntag:attempt3|Attempt 3]]\\ 
- +This has the first useable results! I made my first PCB and programmed an Arduino library. Seems very promising to me and I can feel I´m on the right track
-LDC131X ldc1314(false); +\\ 
-uint16_t lastTen[10]; +\\ 
-int pointer; +[[JanSonntag:attempt4|Attempt 4 (WIP)]]\\ 
- +This is still work in progress. 
-void setup() { +\\ 
-  Wire.begin(); +\\ 
-  Serial.begin(9600); +[[JanSonntag:relatedLinks|Links]]\\ 
-  ldc1314.LDC_resetLDC(); +Here you can find some linksfor which I could not find a place inside of the attemptsThese may be used during development or just as a source of inspiration. 
-  delay(500); +
-  ldc1314.LDC_setConversionTime(0, 0x2000); +
-  ldc1314.LDC_setSettleTime(0, 0x000F); +
-  ldc1314.LDC_setClockDividers(0, 0x1002); +
-  ldc1314.LDC_setErrorConfig(0x0000); +
-  ldc1314.LDC_setDriveCurrent(0, 0xE800); +
-  ldc1314.LDC_setMUXConfig(0x20D); +
-  ldc1314.LDC_setGain(3); +
-  ldc1314.LDC_setOffset(0, 0x4FFF); +
-  ldc1314.LDC_setConfig(0x0801); +
- +
-  pointer = 0; +
-+
- +
-void loop() { +
-  lastTen[pointer= ldc1314.LDC_readData(0); +
-  pointer++; +
-  if (pointer > 9) { +
-    pointer = 0; +
-    int sum = 0; +
-    for(int i = 0; i < 9; i++) { +
-        sum += lastTen[i]; +
-    } +
-    Serial.print("CH0 "); +
-    Serial.println(sum / 10); +
-  } +
-+
-</file> +
- +
-Let's go through this code step by step: +
-  - Import the library and the Wire library (I2C) +
-  - Then instantiate an LDC131X Object (the false means now alternative address) +
-  - The lastTen and pointer variables are needed later to calculate an average of 10 measurements +
-  - The setup starts with initiating the Wire and Serial communication +
-  - Then the LDC gets a factory reset (the documentation states that this may need some milliseconds so implemented a delay) +
-  - On it goes with configuring the LDC (if the function accepts two arguments -> the first one is the channel) (This is roughly done as described on page 48 of the documentation): +
-    - ldc1314.LDC_setConversionTime(0, 0x2000) +
-      - RCOUNT0 +
-      - 0x2000 -> 10000000000000 +
-      - I set this to a higher value than actually needed because in this proof of concept I don't care about fast performance +
-    - ldc1314.LDC_setSettleTime(0, 0x000F+
-      - SETTLECOUNT0 +
-      - 0x000F -> 00000000001111 +
-      - SETTLECOUNT0 ≥ Q × fREF0 / (16 × fSENSOR0) +
-      - Q = 21,495 (See the Webench screenshot) +
-      - fREF0 = 43 Mhz +
-      - fSENSOR0 = 5960,977 kHz ~ 6 Mhz (See the Webench screenshot) +
-      - {{https://www4b.wolframalpha.com/Calculate/MSP/MSP46401i4e44h1bb41h46600004a4935287fa011bd?MSPStoreType=image/gif&s=20&.png?|}} +
-      - 8.9563 + Margin = 15 +
-    - ldc1314.LDC_setClockDividers(00x1002) +
-      - CLOCK_DIVIDERS0 +
-      - default +
-      - FIN_DIVIDER0 +
-        - sensor frequency is less than 8.75MHz? -> yes -> 1 +
-      - FREF_DIVIDER0 +
-        - ƒREF0 is > 4 × ƒSENSOR +
-        - 40Mhz > 4 x 6Mhz -> reference Divider can be set to 1 +
-      - these two combine to 0x1002 +
-      - look up page 21 of the documentation two see the register map for CLOCK_DIVIDERS0+
  
-Directly related links:\\  +<WRAP center round tip 60%> 
-https://www.sciencedirect.com/science/article/pii/S1877050918310135\\  +This project isn't documented all at onceI keep adding stuff on the go
-https://www.cherrymx.de/en/mx-original/mx-red.html#techSpecs\\  +</WRAP>
-https://www.cherrymx.de/en/dev.html\\  +
-http://fabmodules.org/\\  +
-https://www.radiolocman.com/shem/schematics.html?di=162628\\ +
  
-Related links:\\  
-https://git.hsrw.eu/ferdinand.meier/fablab/-/wikis/FabAc_woche04\\  
-https://www.autodesk.com/products/eagle/overview\\  
-https://kicad-pcb.org/\\  
-https://cnc.js.org/\\  
-http://academy.cba.mit.edu/classes/input_devices/index.html\\  
-http://fab.cba.mit.edu/classes/863.12/people/calisch/14/foot.html\\  
-http://archive.fabacademy.org/archives/2016/fablabbcn2016/students/20/jekyll/update/2016/04/19/week-eleven.html 
projects/jansonntag.1612694833.txt.gz · Last modified: 2021/02/07 10:47 by jan