Saturday, November 7, 2020

Homemade Electric Longboard V1

 Last year I threw together a custom 4kW electric longboard using some KEDA outrunner motors and Turnigy ESCs. I wrote my own controlled with an arduino nano, a couple bluetooth transceivers, and a flexible resistor. It worked OK, mostly because the ESCs were crappy and bluetooth dropped out despite me upping the output power to the maximum.

At first with the single motor mounted it looked like this:



Here is a video of the controller sorta working. ESC issues in the first half.


Here is a video of the flexistor working:



Sunday, August 9, 2020

Saturday, August 8, 2020

Making a converter for the Apple Macintosh M0110a Keyboard from Hasu's TMK Firmware and an Arduino Pro Micro

Oof haven't posted in awhile. And yet another silly keyboard project. Work has been absurdly busy lately, and really sucking all of my mental (and sometimes emotional) bandwidth. Hopefully I can get back on track with fun projects again soon. It's felt more of a chore lately, which scares me. It's normally such a relaxing thing to be creating and creative.

The Apple Macintosh M0110a keyboard is a classic beauty with Alps SKCC white linear switches. These have a larger required depress force than the Alks SKCC green switches. So far I have noticed they are a little less smooth, but perhaps that is keyboard specific (mine did have some cruft that I unenthusiastically purged for an hour).


I have chosen to use the Arduino Pro Micro which is based off of the ATMega32u4 because they are hella cheap.

You will want to use the following diagram
Jack fig
This is the pinout with respect to the socket on the back of the keyboard case. Buy one of the 4P4C jacks, and strip the wires. Then, with everything plugged in, confirm continuity to make sure you have the right signals. The clock line should hook up to PD1 and data should hook up to PD0. These are the IO ports on the Atmega microcontroller. On the board I linked above, these are pins 2 and 3 respectively (the numbers shown on the silk screen). Then because the wires are long, I have wired up two pull-up resistors from those pins to 5V as well.

Use this command to find the serial port: ls /dev/tty*
Tty comes form the word 'Teletype.' This command basically shows the available terminals, or serial ports, or other ports from my understanding. You can plug and unplug the microcontroller to see which port it belongs to

Clone the git repository, and change directory to the M0110a directory. You can flash the device with this command:

avrdude -p atmega32u4 -P /dev/tty.usbmodem14201 -c avr109 -U flash:w:m0110_usb_rev1.hex


This will load the currently built firmware to the device. If you want to edit and rebuild then use these make commands with the provided make file:
$ make -f Makefile.rev2 clean
$ make -f Makefile.rev2 [KEYMAP={intl|spacefn}]
Also, the TMK firmware generator linked above will generate these files as well for you. You can then edit the keymap with the web interface and use the hex file that generates (a lot easier!).

If you want to re-load firmware, then (with the arduino powered on) ground the reset pin twice until it shows up in ls TTY. This will only appear temporary, as the device will put itself into bootload mode. Make sure to flash quickly :)

Here's what the keyboard looks like after I cleaned it up a fair amount.
During the cleaning process.. you can see the Alps SKCC switches:
The designers left a little window for the intel chipset running this thing. Date code 1980! 
Here it is sitting next to my IBM Pingmaster 4704 terminal keyboard:























Saturday, May 25, 2019

Pressure Regulators and Other Fluidsy things

So close friends know that I am working on a major rocket project right now.
It involves pressurants, solenoids, regulators, check valves, diffusers, tanks, COPVs, and so many damn more things that *aren't* electronics or guidance algorithms.
So I am learning a lot.

Things to look for in selecting regulators:

  • Inlet maximum pressure: this is the most obvious parameter. You need to select a regulator that will work with the system you are designing. So if it is hooked directly to a helium K-bottle, you're probably dealing with 3000+psi ratings here.
  • Outlet maximum pressure: this is another gimme. If you need to press a tank to 400psi, don't find a regulator that varies to 10psi output.
These two are hard enough to spec out for high pressure rocket systems. Then on top of that you have:
  • C_v Flow Coefficient: this one is super important and is probably the most overlooked thing in my experience. Your device must be able to flow a lot of fluid to keep up with the dynamics of the system. If the effective orifice size is small, then it will not have a high mass flow rate. 
It is defined as such:  $C_v = Q \sqrt{\frac{SG}{\Delta P}}$.  You can think of Q as your $\dot{m}$. SG is your specific gravity, which is normally unity (1 for water) on data sheets (I think). And $\Delta P$ is the pressure drop across the system. So basically the higher this coefficient, the higher the flow rate, and the lower the pressure drop.

This equation is meant for incompressible fluids, and the gas equation is more complicated. Swagelok has some good info here: https://www.swagelok.com/downloads/webcatalogs/EN/MS-06-84.PDF

The flow coefficient is important for all fluid devices that constrict flow. So just be careful when you're attempting to procure random devices on eBay. Finding stuff for reasonable prices is hard, so I always watch out for these brands:
  • Marotta
  • Aqua Environment
  • Tescom
  • Swagelok
YOU CAN get away with low flow regulators if you attach their output to the membrane of a dome loaded reducing regulator. This seems like the usual way to do things, rather then flow directly from a single hand-turn regulator. Grove Mity Mites were apparently the way to go back in the day. There is a new company that makes them with the same design you might want to watch out for.