Friday, November 9, 2018

Datalux Keyboard Teardown

Ok. This was an impulse buy. But when it arrived it was missing two keycaps, so I got a refund. That means I'm off the hook from the impulse buy right?

Anyways I saw this pretty thing on ebay: the Datalux MURUC
It was so clean, and look at that funky shape!!! This one was 85 bucks, but I wasn't going to shoot for anything above $15. Anyways, it is widely considered a bad, mushy mechanical keyboard. But like I said, impulse.
So here is the one that I got, and then was refunded for.




As you can see, mine was not as beautiful. It came with a bunch of missing keys. It also smelled like veritable trash heap (as opposed to stack). So.. I decided that it was not worth it to fix up; so I tore down. Here are my electromechanical archaeological findings:


The keyboard uses these surface mount MEI white linear switches. I have never heard of this brand! They are pretty smooth, but also very stiff (maybe like 70 to 80 grams). Also only expect key travel of 3 millimeters or so.
The single sided PCB appears, next to the space bar, to have a date code of 30th week of 1990, which I believe. Another interesting thing, is that I only see ghosting rollover diodes near the space bar and nowhere else. I don't have a picture of the traces and the soldermask on the bottom so you will have to believe me. Also notice the oscillator is Earth-grounded. Look at that linear resistor package too!
Additionally, the main integrated circuit is a Signetics  jobby with date 1980. I could not find any specific information on this part number, but I did find an interesting microprocessor data manual from 1983. I can't seem to find any chips with the MC designation, as most have the SC label.
I am in the process of cleaning the remaining keycaps in case I need them for a project.

Flashing SimonK firmware on a Red Brick 200A ESCs

So I got this ESC here. They are, as most Chinese ESCs are, suspiciously priced. I do not recommend them for the lack of testing I have done. I`ve been designing a linear actuator for a thrust vector control system and needed to make a mockup with some cheap parts. This ESC was particularly intriguing as it has an Atmega8 processor, meaning that I can reflash it with SimonK firmware, and also modify that firmware so that I can run the motor in both directions (tends to be important for linear actuators....). Most of this process I learned from this video by Robert Cowan (a cool dude, check his work out), but I had numerous more issues that were not covered in his video; so here I document that for you.


Note that the MOSFETs used for switching are all paralleled. If you used transistors from the same silicon batch, they should share the current normally. After all, most single package semiconductors like this are just a bunch of small devices in parallel on the substrate. However, in this case, they have decided to use a bunch of different transistors, and I wouldn't be surprised if this led to a failure later on under higher load conditions. Maybe they got a deal on a rando box `o FETs. Also you`re not seeing that the heatsink was held in place by heat shrink. So once you remove the covering... it just falls off.

Sigh. I should just fab some of these...

This reprogramming process only works for certain ESCs with ATMEGA8 chipsets. So keep this in mind if you are going to do this yourself. This list here includes a lot of the different ESCs that are supported, as well as their flavour of firmware binaries.

First you are going to need a USBASP dongle so that you flash the chip. This is basically a bad version of an atmel ICE or similar programmer. They're super cheap so sometimes they arrive in odd nonfunctioning states. The things we deal with. It might be worth it to pick up a couple.

Then you will need to open up the ESC and find the appropriate programming pins, and wire up a harness for programming.

This figure is taken directly from the data sheet for the atmega8 chip. You need Vcc, GND, MOSI, MISO, SCK, and RST(pin 29) to connect ot the programmer. Your ESC may have these conveniently laid out. Mine sort of did? Whoever designed this board ported them out to pads of 0402 size, and then had nothing populated on them. My best guess is that they had some special programming pogo-contact tool that allowed the factory (in god knows where shenzhen) for quick programming


I have also listed the pinout of the connector on the USBASP above on the engineering paper. Note that the box I drew denotes looking into the gated connector (so you should be seeing male pins). I cut up some female header jumper wires and soldered them to the programming "pads." Note that VCC was much easier to tag onto the linear regulator. I think I also omitted RST in this picture, but added it on later.

You`ll need to get the USPASP driver running, so head off to zadig, download the software and run it. This basically finds drivers needed for whatever peripherals it senses on the USB bus (i know...). So plug in the dongle and do that.

The head over to lazyzero and get the kkmulticopter flash tool. You will actually want both version 0.77 and 0.8. The latter will be run for programming your chip, but won't work without a file from the former. Make sure that you have downloaded the proper java run time environment. This proved to be very difficult. I recommend downloading the whole offline file and running it.

Otherwise you might get this error:
No JVM could be found on your system.
Please define EXE4J_JAVA_HOME
Even now, if you run the 64bit distribution of kkmulticopter it probably won't work. In my case, running this produced an error file that said it didn't have some of the required files. I went over to my 0.77 version folder and brought kkMulticopterFlashTool.properties over.. and it seemed to work.

Oh yeah you might also need to add the file path of Java RTE to your environmental variables, as well as EXE4J_JAVA_HOME as a variable name, with its path as its descriptor. (I am on windows 10 by the way).

Now it should finally run and stop giving you errors? Hopefully?


Open the tool, go to the simonk firmware section, hit download and pick your binary. In this case I am using birdie70A. I changed the lines 188 to high, and 189 to low so that I can run the motor in both directions.
Just kidding I have this error. I am still working on a fix for this. Some places say this is caused by the clock frequency being too high and having a "slow SCK" issue. Some people say that this is bogus and it has flashed correctly anyways... I'm going to keep working this one out.

Almost there!!!













Saturday, November 3, 2018

New Keymap for IBM4704 6113442 Pingmaster

So here I am again procrastinating on my orbital dynamics by working on firmware for antiquited technology.

Here is, imho the best keymap for this keyboard. I have extended the right keys. This means that the backspace now takes up the right most three units, the enter is two keys, and shift is two keys. The Hasu map had some weird function keys there that would get very annoying when you pressed the wrong button.

Go into the keymap_alps102key.c file and use this:

KEYMAP_ALPS102(
    ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,BSPC,BSPC,     PSCR,SLCK,PAUS,    F1,  F2,  F3,  F4,  \
    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS,     BSLS,       INS, HOME,PGUP,      F5,  F6,  F7,  F8,  \
    CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,GRV, ENT,      ENT,     DEL, END, PGDN,       F9,  F10, F11, F12, \
    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT,RSFT,    RSFT,     NO,  UP,  NO,              F13, F14, F15, F16, \
    LCTL, LGUI,LALT,          SPC,                     RALT,RGUI,               FN0,               LEFT,DOWN,RGHT,    F17, F18, F19, F20  \
    ),

Now obviously do as you wish, but I like this setup the most. I might change the function keys on the right later. I really don't use function keys much.

I then edited the Makefile.unimap.alps.rev1 file by deleting the unimap line. We want everything else because we still want the 32u4 etc.

Then remake with make -f Makefile.unimap.alps.rev1 KEYMAP=alps102key
Then ground the RST pin and reflash as per my last entry, and there you go.

Wednesday, October 31, 2018

Converting the IBM4704 Model 6113442 with an Arduino Pro Micro atmeta32u4

HERE is the keyboard. It's only $35. Snatch one of these up before they are all gone! They are seriously one of the coolest keyboard that I have ever used. Pros: ultra-smoothness of Alps Green linear switches, with the new-old-stock IBM hardware, seeeeriously beefy keycaps, and cool characters hinting at its intended use and market back in the day. Honestly please go get this cool piece of history.

Cons: there is a reason it is called the "Pingmaster"... the damn chassis pings like crazy.

All firmware credit goes to hasu. The guy is a champ. I was way too lazy to figure/decode/reverse engineer the encoding coming out of this dude. I'm sure you are too. If you are even lazier, go buy a converter from him!

NOW TO CONVERT!
Anyways go download the TMK firmware. Then follow these instructions on installing the proper tools that we will use. This will also explain things for windows. Once this is done, cd into converter/ibm_4704 directory. Run make -f Makefile.unimap.alps.rev1   . This will run the makefile which tells the AVR toolchain to compile all the things, and generate a .hex binary to directly flash to the device. The great thing about the atmega32u4 is that it can be connected to directly over USB and already has installed the CATERIN programmer. So no finicky extra tools and things to fail (I'm looking at you atmel ICE and almost every firmware programmer/jtag thing i have ever used). OKAY enough ranting.

For unix systems write the command ls /dev/tty* to see all of the listed connected devices. Connect your arduino and find the one that has changed. This is now the serial port you are going to write to. (the one I just found was /dev/tty.usbmodem1421)

Then run :
avrdude -p atmega32u4 -P  <your serial port> -c avr109 -U flash:w:ibm4704_usb_rev1_alps_unimap.hex

HOWEVER: seconds before you send this line, ground the reset pin (RST) pin of board TWICE to put the thing into bootload mode. This can be tricky, but you got it; i believe in you.

Once this is done, it should be prime. Follow this hookup guide that I got from Hasu's readme:
DSUB-9
-------------
\ N 2 3 4 5 /
 \ N N N N /
  ---------
2   GND
3   VCC 5V
4   DATA
5   CLOCK
N   No connection/No pin.
Data goes to pin 2 (PD1) of the Pro Micro, and Clock line goes to pin 3 (PD0).
LMK if you have any questions.

ALSO the keymap is garbage. I shall work on it and add more on it in the future (i know because I wrote this whole thing using the keymap....)


Additional resources:
More on the avrdude command




Wednesday, October 24, 2018

this is a test

I am testing the features of this blogger format. We'll see if I actually end up using it.


This is also a test. Perhaps you'd like to email me.
Draper and von Braun doing rocket stuff. Probably for flight.
The image sizing features are not great.


Let's look at some latex!!!
$\begin{align}
& x_{t+1} = A_t x_t + B_t u_t + w_t \\
& y_t = C_t x_t + D_t u_t + v_t
\label{eq3}
\end{align}$

hmmm
$\begin{equation}
{{\displaystyle J(\mathbf{x},\mathbf{u})=\mathbb {E} \left[{\mathbf {x} }_{N}^{\mathrm {T} }Q_T{\mathbf {x} }_{N}+\sum _{i=0}^{N-1}(\mathbf {x} _{i}^{\mathrm {T} }Q_{i}\mathbf {x} _{i}+\mathbf {u} _{i}^{\mathrm {T} }R_{i}\mathbf {u} _{i})\right]}}
\end{equation}$

okay some things are definitely tricky.