Author Topic: Modifying the Ergodox EZ with haptic feedback  (Read 5651 times)

0 Members and 1 Guest are viewing this topic.

Offline _PeterG_

  • Thread Starter
  • Posts: 6
  • Location: Germany
Modifying the Ergodox EZ with haptic feedback
« 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). 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) and the open source schematics of the Ergodox EZ on github (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) 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:



¹ 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.
« Last Edit: Sat, 04 July 2020, 06:15:18 by _PeterG_ »
daily driver: Ergodox EZ & custom build TKL with an adapted NEO2 layout
retired: 88-key & 105-key WASD v2.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Modifying the Ergodox EZ with haptic feedback
« Reply #1 on: Sat, 04 July 2020, 15:54:42 »
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.
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline _PeterG_

  • Thread Starter
  • Posts: 6
  • Location: Germany
Re: Modifying the Ergodox EZ with haptic feedback
« Reply #2 on: Sat, 04 July 2020, 17:46:57 »
Thank you very much for your reply!

Quote
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.

Quote
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.

Quote
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:

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.

Quote
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?
daily driver: Ergodox EZ & custom build TKL with an adapted NEO2 layout
retired: 88-key & 105-key WASD v2.

Offline _PeterG_

  • Thread Starter
  • Posts: 6
  • Location: Germany
Re: Modifying the Ergodox EZ with haptic feedback
« Reply #3 on: Thu, 09 July 2020, 16:25:17 »
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.
daily driver: Ergodox EZ & custom build TKL with an adapted NEO2 layout
retired: 88-key & 105-key WASD v2.

Offline _PeterG_

  • Thread Starter
  • Posts: 6
  • Location: Germany
Re: Modifying the Ergodox EZ with haptic feedback
« Reply #4 on: Tue, 14 July 2020, 09:59:15 »
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


Final haptic motor placement
daily driver: Ergodox EZ & custom build TKL with an adapted NEO2 layout
retired: 88-key & 105-key WASD v2.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Modifying the Ergodox EZ with haptic feedback
« Reply #5 on: Sun, 19 July 2020, 02:51:37 »
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.
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline desipalen

  • Posts: 30
Re: Modifying the Ergodox EZ with haptic feedback
« Reply #6 on: Sun, 26 July 2020, 11:12:23 »
Such a neat project. I'll follow with rapt attention.

Offline clicks

  • Posts: 9
  • Location: world wide web
Re: Modifying the Ergodox EZ with haptic feedback
« Reply #7 on: Tue, 28 July 2020, 02:12:57 »
This is exciting, I would like to build something like this! :thumb:
.
.
Ị̸͚̯̲́ͤ̃͑̇̑ͯ̊̂͟ͅs̞͚̩͉̝̪̲͗͊ͪ̽̚̚ ̭̦͖͕̑́͌ͬͩ͟t̷̻͔̙̑͟h̹̠̼͋ͤ͋i̤̜̣̦̱̫͈͔̞ͭ͑ͥ̌̔s̬͔͎̍̈ͥͫ̐̾ͣ̔̇͘ͅ ̩̘̼͆̐̕e̞̰͓̲̺̎͐̏ͬ̓̅̾͠͝ͅv̶̰͕̱̞̥̍ͣ̄̕e͕͙͖̬̜͓͎̤̊ͭ͐͝ṇ̰͎̱̤̟̭ͫ͌̌͢͠ͅ ̳̥̦ͮ̐ͤ̎̊ͣ͡͡n̤̜̙̺̪̒͜e̶̻̦̿ͮ̂̀c̝̘̝͖̠̖͐ͨͪ̈̐͌ͩ̀e̷̥͇̋ͦs̢̡̤ͤͤͯ͜s͈̠̉̑͘a̱͕̗͖̳̥̺ͬͦͧ͆̌̑͡r̶̟̖̈͘ỷ̮̦̩͙͔ͫ̾ͬ̔ͬͮ̌?̵̘͇͔͙ͥͪ͞ͅ
`
'

Offline Pyk_

  • Posts: 58
Re: Modifying the Ergodox EZ with haptic feedback
« Reply #8 on: Sun, 02 August 2020, 08:11:28 »
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?

Offline _PeterG_

  • Thread Starter
  • Posts: 6
  • Location: Germany
Re: Modifying the Ergodox EZ with haptic feedback
« Reply #9 on: Mon, 03 August 2020, 06:09:56 »
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), 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.
daily driver: Ergodox EZ & custom build TKL with an adapted NEO2 layout
retired: 88-key & 105-key WASD v2.