geekhack
geekhack Projects => Making Stuff Together! => Topic started by: _PeterG_ on Sat, 04 July 2020, 05:27:32
-
Hi geekhackers,
long time reader, first time poster here ;-)
I would like to mod my Ergodox EZ with a haptic feedback motor¹. QMK supports this via the DRV2605 feedback driver IC via the I2C bus (https://beta.docs.qmk.fm/using-qmk/hardware-features/feature_haptic_feedback (https://beta.docs.qmk.fm/using-qmk/hardware-features/feature_haptic_feedback)). I know from this post on keeptalk (https://www.keebtalk.com/t/did-anybody-try-to-mod-their-ergodox-ez-with-a-custom-led-array/2286 (https://www.keebtalk.com/t/did-anybody-try-to-mod-their-ergodox-ez-with-a-custom-led-array/2286)) and the open source schematics of the Ergodox EZ on github (https://github.com/zsa/docs/blob/master/Ergodox%20V5-L.pdf (https://github.com/zsa/docs/blob/master/Ergodox%20V5-L.pdf)), that the J1 connector on the left hand half is connected to the teensy's I2C bus. As far as I know, this connector is used for the underglow feature of the EZ. Since mine does not have this features, there is no connector soldered to the PCB there. It's free real estate to tinker with! ;D
Before working on my daily driver EZ, I tested my breakout board with the DRV2605 chip (https://learn.adafruit.com/adafruit-drv2605-haptic-controller-breakout (https://learn.adafruit.com/adafruit-drv2605-haptic-controller-breakout)) on a spare teensy with QMK. It worked just fine. I could use various vibration patterns triggered by all sorts of events (greeting on startup, keypress, macros, ....). Conclusion: The individual hard- and software components work.
Afterwards I soldered the breakout board to the J1 connector on the left hand side of my EZ and enabled the haptic feedback feature in my QMK firmware. Note that I soldered the GND and Vcc of the breakout board directly to the power lines on the TRRS connector. And to my supprise, the feedback works. Sometimes. It does not trigger reliably, i.e. when I press the feedback test button, it only works if the excentric mass of the motor is in a certain position.
This means to me that the communication between the DRV2605 and the EZ's teensy should work (at least to some extent) and that there is enough power supplied to the electronics. Does anyone have experience with using the I2C bus on the Ergodox EZ for some additional components? I would be thankful for any hint I could try to make it work reliably.
cheers!
Edit 1: Here is a picture of how it looks like internally:
(https://imageshack.com/i/pnVmAk92p)
¹ Why? I use the QMK leader key function a lot. Some macros I trigger don't have clearly visible effects on screen, so I would like to have feedback whether I triggered the leader key sequence or not. I know this could be done with the built-in LED array on the top, but I don't clearly see that all the time, due to tenting the right half outwards.
-
Do I see a short between GND and SCL on the breakout board? Probably just the angle but worth checking.
If not I'm thinking that somewhere there are two resistors (one on the main PCB and one on the breakout board) where only one is needed so the data signal or the power to the motor is weaker than it should be. Or maybe one of the two chips I see (can't read the labels) is an RGB controller that's still using power, maybe more than if it were being told to be off?
Failing that is there enough height to mount the motor vertically? It wouldn't be fighting gravity to spin then so should work with the reduced power (assuming that is why it only spins in certain positions) There's probably space with no traces in that corner of the PCB.
-
Thank you very much for your reply!
Do I see a short between GND and SCL on the breakout board? Probably just the angle but worth checking.
I see what you mean with the short. I checked all solder joints, no issues here.
If not I'm thinking that somewhere there are two resistors (one on the main PCB and one on the breakout board) where only one is needed so the data signal or the power to the motor is weaker than it should be.
Good idea! I totally missed that. I removed the pull-up resistors on the DRV2605 board -> No change in behavior.
Or maybe one of the two chips I see (can't read the labels) is an RGB controller that's still using power, maybe more than if it were being told to be off?
I am not sure what chips you are referring to. The ones on the EZ's PCB are:
- MCP23018 16-Bit I/O Expander with Open-Drain Outputs https://docs.rs-online.com/6203/0900766b8137eed9.pdf (https://docs.rs-online.com/6203/0900766b8137eed9.pdf)
- P82B715I2C Bus Extender: https://www.ti.com/lit/ds/symlink/p82b715.pdf?ts=1593902267596&ref_url=https%253A%252F%252Fwww.google.com%252F (https://www.ti.com/lit/ds/symlink/p82b715.pdf?ts=1593902267596&ref_url=https%253A%252F%252Fwww.google.com%252F)
I am quite sure that the first one is responsible for polling the matrix on the Ergodox EZ's left hand side, but not so sure about the purpose of the second chip.
Failing that is there enough height to mount the motor vertically? It wouldn't be fighting gravity to spin then so should work with the reduced power (assuming that is why it only spins in certain positions) There's probably space with no traces in that corner of the PCB.
After dismounting it from the PCB, I tried different orientations, no change in the behavior.
Since the EZ is using custom matrix scan code, which relies on the I2C bus, could it be possible that the bus is just too busy to reliably transmit the required signal to the DRV2605?
-
quick update on the project:
After studying the hard- and software side of things more carefully, I am quite convinced that the configuration was correct. So I soldered the motor and driver chip back to the spare teensy. Initially I used this configuration to verify the components - so I know this should work. It ceased working! This is a clear indication that at least one of the components is damaged. Another set is ordered.
-
It works! :thumb:
After swapping out the faulty driver board, it functioned as intended. Removing the pull-up resistors on the board is not necessary, the I2C bus works with the set of additional ones just fine. The only change I made was to move the excentric mass right below the cut-outs for the underglow LEDs (see the second image below). Otherwise it would hit the EZ's housing occationally and make a nasty sound.
Last but not least: Huge thank you to drashna from ZSA Technology Labs, Inc. for answering my questions via email!
Final electronics configuration
(https://imageshack.com/i/poCxCFBaj)
Final haptic motor placement
(https://imageshack.com/i/pnZSy9RPj)
-
That's great to hear, surprised you got tech support on an individual ordesor too so ZSA Technology Labs have been added to my mental list of recommended toymakers.
Would be interesting to feel how much feedback you get with the tiny mass in a big board, at least it shouldn't be annoying like on a phone.
-
Such a neat project. I'll follow with rapt attention.
-
This is exciting, I would like to build something like this! :thumb:
-
When I read the title I was imagining those little stick on haptic motors on every key. This method probably makes more sense!
Is the motor specifically a haptic motor or would any motor that size work?
-
Sorry for the delayed reply, I was quite busy at work.
That's great to hear, surprised you got tech support on an individual ordesor too so ZSA Technology Labs have been added to my mental list of recommended toymakers.
Would be interesting to feel how much feedback you get with the tiny mass in a big board, at least it shouldn't be annoying like on a phone.
The feedback is definitely easily noticeable but not too strong. The DRV2605 controller chip supports 123 different vibration patterns (see https://beta.docs.qmk.fm/using-qmk/hardware-features/feature_haptic_feedback (https://beta.docs.qmk.fm/using-qmk/hardware-features/feature_haptic_feedback)), most of them in various strengths between 30% and 100%. While 30% is barely recognizable and, with the keyboard on my desk mat, inaudible, 100% is easily noticeable and audible but not annoying or too loud.
Currently I use three different feedback patterns:
pattern 53 (pulsing_strong_80) to indicate leader key sequence failure -> obviously noticeable, barely audible
pattern 26 (sharp_tick3_60) to indicate leader key sequence success -> noticeable if you are expecting it, basically inaudible
pattern 94 (transition_rampdown_long_smooth1_50) to indicate that the keyboard is being reset -> very obviously noticeable, audible, because the ramp down takes 1s
When I read the title I was imagining those little stick on haptic motors on every key. This method probably makes more sense!
Is the motor specifically a haptic motor or would any motor that size work?
I don't think haptic feedback on every key would work that well. (But I like the over the top nature of the thought ;D ) Even with that tiny motor, the whole keyboard vibrates and it is hard to feel where the vibration comes from. So I guess it would be almost impossible to tell which key actually vibrates.
As far as I can tell, the motor itself nothing special apart from the eccentric mass on its shaft. So I guess you could use any other actuator, as long as it generates the vibrations. The logic of the different vibration patterns is handled by the motor controller board anyway.