Sunday, June 5, 2011

Motorized scooter

A while ago, I decided I wanted to build a motorized scooter. Brilliantly, I decided I wanted to build my own motor. I'm still pretty sure I could given more time but it'd be tedious and require a lot of redesigning. I might go back and try to do that in the future.

In the meantime, I've decided to switch to a brushless DC outrunner motor from Hobby King.

It should be a lot more powerful then the hub motor and I can use it with the same controlled I had bought for my hub motor. I'm switching to a belt drive and redesigning the back of my scooter a little. My current wheels are a little small so I'm springing for some nice 8" wheels from electricscooterparts.com. I still need to finish the design of the mount and figure out how to build it, but I might jump ahead and order everything I need for the belt drive. Almost everything else can probably either come from around MIT or McMaster so it won't take as long. Hopefully I'll be zooming around with a motor in the next few weeks.

Saturday, June 4, 2011

Sad scooter

While I was riding back from MITERs earlier tonight I noticed something strange was happening with my scooter's steering...

Didn't there used to be a nut there?

I have no idea when it happened (I didn't hear it), but the nut I had on the front wheel unscrewed itself and the screw had slide out so far the spacer on the inside of the fork (adjacent to the wheel itself) also fell out. My wheel looked like it was a few seconds from falling off when I noticed it. The fork ripped the hub up a little but it's nothing too bad, it's just superficial damage. I carefully rode it back to EC sans-nut since I was too lazy to walk it back. It should be a really simple fix. I just need to machine a new spacer, find a new nut and get some locktight or something similar to stop this from happening again. I guess I'll be walking to MITERs tomorrow.

3d printing!

The start of a gantry 3d printer. The toolhead will move on the X and Y plane and the build platform will move along Z. If it turns out as planned, it'll probably have a build area of around 10"x10"x12". Most (possibly all) of it's structure will be aluminum angles and bars bolted together. I haven't figured out a good way to keep all the joints straight yet but that shouldn't be too hard.

Wednesday, May 25, 2011

Very crude password generation

Generates 25 passwords which alternate between the left and right hands for each character, have alphanumerical plus symbols and never require holding down shift. Coded while playing Super Smash Brawl at 3am so I bet there's a million horrible things about it.

import random

alpha_left = ['r', 'q', 'w', 'e', 'r', 't', 'a', 's', 'd', 'f', 'g', 'z', 'x', 'c', 'v', 'b']
num_left = ['1', '2', '3', '4', '5', '6']
symbols_left = ['`']
alpha_right = ['j', 'k', 'l', 'n', 'm', 'h', 'y', 'u', 'o', 'i', 'p']
num_right = ['7', '8', '9', '0']
symbols_right = [';', "'", '[', ']', '.', ',', '/', '-', '=', '\\']

left = [alpha_left, num_left, symbols_left]
right = [alpha_right, num_right, symbols_right]

def gen_pw ():
passwd = ""

for i in range (8):
if i % 2:
cata = left[random.randrange (3)]
else:
cata = right[random.randrange (3)]
passwd += cata[random.randrange (len (cata))]

return passwd

def check_pw (p):
has = [False, False, False]

for c in alpha_left:
if c in p:
has[0] = True
for c in num_left:
if c in p:
has[1] = True
for c in symbols_left:
if c in p:
has[2] = True
for c in alpha_right:
if c in p:
has[0] = True
for c in num_right:
if c in p:
has[2] = True
for c in sym1ols_right:
if c in p:
has[2] = True

if False in has:
return None
else:
return p

pwlist = []
while len (pwlist) < 25:
tmp_pw = check_pw (gen_pw ())
if tmp_pw:
pwlist.append (tmp_pw)

print pwlist

Wednesday, May 11, 2011

Door + electronics

So far it's just a couple status LEDs (door open/closed and a "doorbell") and sketchy wires but I'm planning on cleaning it up once I have time.
All the resistor values are completely arbitrary, I grabbed them at random and they work. If I thought it through I could probably get the LEDs a little brighter but it doesn't matter too much. The only important things are that the resistors are large enough so the LEDs don't burn out and R2 has to be small enough to pull enough of the current so the LED doesn't turn on.

Left LED is red, right LED is green
Bare wires, when you short them together the red LED turns on. I'm planning on putting a nicer button here
Aluminum tape on the door and weather stripping (convenient for sealing a door and guaranteeing good contact!) with wires duct taped on each contact, since only the non-sticky side of aluminum tape is conductive.
All of it together:
Yay!

EDIT: As several people have pointed out, it would be smarter to do the door switch with a transistor. The reason I didn't was because the circuit got about a minute of thought (if that) and I just grabbed a few parts near me.

Electric scooter

Mid February, I decided to build an electric scooter. Unfortunately I didn't write up what I was thinking along the build, but I took a lot of pictures. I finished the majority of the mechanical work (minus mounting the motor and I still don't have a brake) in late March and have been using it as a kick scooter since then. When I'm done, it will have a hub motor I built, a motor controller I bought, and as many batteries as I can possibly back into the base. I'm hoping for a 10 mile range but I have no idea how efficient the motor will be yet.

Pictures and write-ups of some of the choices I made and the ways I built things coming soon, finals week is coming up so I'm short on time.

Wednesday, June 9, 2010

Emacs with Google Go

With this set up, hitting H-m (hyper-m) in emacs it compiles the current buffer and runs it if compiling succeeds.

; current-buffer-name.go
; make current-buffer-name && ./current-buffer-name
(defun compile-run ()
(interactive)
(setq name (first (split-string (buffer-name (current-buffer)) "[.]")))
(compile (format "make %s && ./%s" name name)))

; assigns hyper-m (I have the Windows key set as hyper) to running compile-run
(global-set-key (kbd "H-m") 'compile-run)


And the piece of my Makefile that handles this:

%: %.go
6g $^
6l -o $@ $@.6

You'll have to tweak the Makefile stuff if you want to compile for anything other than amd64.

The compile-run function should actually work for any language, as long as you get the Makefile set up correctly.


Edit: Here's a version that just compiles and doesn't run the current buffer (you'll still need the same Makefile entry above)

(defun compile-buffer ()
(interactive)
(setq name (first (split-string (buffer-name (current-buffer)) "[.]")))
(compile (format "make %s" name)))

; Sets meta-m (AKA alt-m or escape-m, or command-m on Macs)
(global-set-key (kbd "M-m") 'compile-buffer)