December 29, 2013

More Snow Scootering

More messing around with the snow scooter outside of MITERS.  Now is just needs modular tank treads for the back to match the modular ski in the front.

December 16, 2013

Snow Scooter!

In the hours after MEETERS at MITERS, Dane and I came up with a ski attachment for our scooters, for the purpose of snowy scooter shenanigans.  Both our scooters have the same axle diameter, so switching it from scooter to scooter just takes adding a few shaft collars for spacing.

It was definitely a success.  Fast turns cause the back wheel to slip out, and at one point I accidentally turned too fast and did a 180 at speed.  Fortunately since the ground was covered in snow, it was a pretty soft landing.  The brake is pretty much useless, but you can stop quickly shifting your weight forward and going into a sideways slide, like you would on skis.

Credit for the last two photos to Billy Demaio

Belt Reduction #2 Finished

After another end of the week blitz on the CNC mill, I finished the second belt reduction.  The second differs from the first in that it supports the entire arm, while the first only drives a linkage to actuate the second link of the arm.

I started by pocketing the solid aluminum pulleys to make them lighter.  To get rid of any slop in the arm, the arm is supported by a pair of tapered roller bearings.

The arm, the first length of which for now is a thin-walled aluminum tube, is clamped in place with this aluminum block.  This arrangement allows the arm to be taken off the belt reduction by the removal of one bolt.  That way I can do the programming and control side of things without the arm in place.  This will stop the arm from self destructing by smashing into its physical limits.

A long bolt passes through the bearings, aluminum block, and pulley to preload the tapered roller bearings:

The two reductions will look roughly like this when assembled.  I still need to make the plates that connect the output pulley of the smaller reduction to a linkage.  Unfortunately, the 1/8" endmill I've been using to machine all these parts snapped 3/4 the way through making the first of those plates.

Next up is making the second link of the arm, as well as the linkage that actuates it.  More updates can be expected in early January.

In other news, Cambridge got snow this weekend.  SkiScooter pictures and videos will appear shortly.

November 30, 2013

CNC Everything

Just before last summer, a lab donated their old CNC mill to MITERS, in a mostly-not-working state.  Until now, I have not had a project that required any CNC machining, and even for this project I designed the parts for the belt drive reductions to be water jet cut, rather than CNC milled.  However, over this break my source for water jet access was out of town, so I decided to learn how to operate the MITERS CNC mill instead.

Here is one of the motor mounts, just after machining:

And here is a part in progress:

The parts look beautiful, with practically polished edges, compared to the extremely coarse edges left by an abrasive water jet.

so shiney
To make the standoffs, I used my old technique of making a clamping jig, so that I could face the ends off all the standoffs simultaneously.

Wherever possible I used countersunk stainless fasteners, for added shininess:

One great thing about CNC milling parts, rather than water jetting them is that I can make precise press fits for bearings without any fiddling with tool offset.  If I CAD my part with a hole .001" too small for the bearing, the mill machines a hole exactly that size.

And here's the assembled unit.  It is still missing the attachment for the linkage on the output 60 tooth pulley.

November 7, 2013

Electric Tricycle: 9 Month Service, Painting, and Data Collection

After almost nine months of use, the trike has gotten pretty gross.  Since all the mechanical bits are directly behind the front wheel, they get sprayed with everything the front wheel goes through, be that water, dirt, snow, sand, or anything else.  There was also some bare steel on the frame, which got pretty rusty.

Much of the grime came off with the help of rags and solvents.  I could not get the differential really clean without completely taking it apart, so I just wire-brushed as much of the gunk out as possible and regreased it with some thin teflon lubricant.  The chains were cleaned by putting them in a cup full of acetone and leaving them on an agitator platform.

I stripped down the steel part of the frame, and removed all the old paint and rust with an angle grinder.  I primed the frame with self-etching primer, and spray painted it red.

Before painting the frame, I briefly reassembled the trike to take it to the Swapfest garage, and finally collect some power and time data to compare it to the rest of the MIT small electric vehicle fleet.  For some reason the Kelly controller started to cut out almost immediately, making the trike useless.  Somehow during the reassembly process the sensor timing seems to have gotten messed up, despite the fact that I know the sensor positions did not change.  This, plus the continual other Kelly controller problems I've had (inability to max out the current limit, over current shutdown in the higher gears) lead me to buy a high-speed version of the same Kelly controller.  According to Shane, the high speed controllers have higher PWM frequency, which means less current ripple.  The (assumed) reason the Kelly's sometimes shut down rather than current limiting as they are supposed to is that the current control loop is not fast enough to prevent current spikes from exceeding the hard overcurrent shutdown.  Faster PWM means smaller current spikes and a faster current control, which should prevent the over current protection from being tripped.

The controller upgrade turned out to be a mixed bag.  It does seem to have fixed the overcurrent shutdown.  I can now full throttle in eighth gear from a stop without shutting off the controller, which I could never have done before.  However, acceleration felt slower than with the old controller.  A clamp meter on a motor phase read a max current 0f 75-80 phase amps during acceleration, which is well shy of the 120 peak amps the controller is rated for.  Unfortunately, I never did the same test with the old controller, so I can't directly compare numbers.  It feels off though.  More testing and diagnostics will come later.

Science Time
Before the cleaning and controller upgrade, Jaguar and I took the trike to the Stata parking garage to do some test laps with a wattmeter inline with the battery.  Using the pillars and dividers in the parking garage as obstacles, we've come up with a fun track involving a combination of tight turns, slalom, and straight-aways.

We each did at least one test lap in each of the eight gears, as well as some laps using all the gears.  The results were a bit surprising.

The first graph is Watt-hours consumed vs lap time, a metric taken from Charles and Shane's garage vehicle testing.  The number by each point corresponds to the gear used.  My laps are the red x's, and Jaguar's the blue o's.  First thing you notice is that gears 1 and 2 use way less energy than the others.  I'm fairly sure that this is because in gears 1 and 2, you can basically full throttle the entire lap without ever needing to brake.  Constant high speed operation is where electric motors are the most efficient.  Times for first and second gear were not as slow as I expected either.  I think this can be attributed to the shorter line you can drive at lower speed.  In first and second gear the trike as an incredibly tight turning radius, so you can take all the corners sharply and travel less distance over the lap.

Also interesting is that using all eight gears is barely any faster than using just using 4, 5, or 6th gear.  My best time with all 8 beat my 5th gear time by .75 seconds out of ~30, which is definitely within normal lap-time deviation.  Just fifth gear was significantly more efficient, using over an entire Watt-hour less energy over the lap.

Now Watt-hours*seconds vs gear.  The difference between my results and Jaguar's comes mostly from weight.  Results past 5th or 6th gear I don't think are completely valid, because in those gears it was impossible to max out the throttle without the Kelly controller cutting out.  So power consumption was lower and times higher than they could have been in the top gears.

Something else interesting was that the watt-meter never recorded battery side current greater than about 65 amps, or 2.6 kW.

The only conclusion I can really make from the data is that (for driving around this test track) if you are not really good at shifting, trying to use the gears will make you slower.  Your best bet is to just stick to 5th gear.  I've been riding the trike for a while now, and my multiple gear time was barely better than just 5th gear time.

Also, new riders seem to instinctively shift when they can't go any faster in a particular gear.  Which is a terrible time to shift if you want to maximize power.  If you go back to my first electric trike post ever. you can see some power vs gear ratio curves overlaying the 8 ratios on the Shimano gearbox.  The optimal shifting point is actually when the motor is a little past 1/2 its no load speed.  What I should do is make some indicator lights to tell you when you should be shifting up or down based on the motor speed.

Next up:  more robot arm.

October 31, 2013

Robot Arm: Testing Construction Methods and More Design

I CADed up a 3D-printable test arm, to see how well adding carbon fiber over ABS plastic would work:

And then printed it in two parts on a Stratasys uPrint.  The two halves were superglued together.  The full part would have just barely fit diagonally on the uPrint's print bed, but I split it into two parts so that I could also print test pieces on my own UP! if needed.

I machined an aluminum end for it:

Next step was adding carbon fiber to the arm.  To compress the carbon and epoxy, I heat-shrinked the wet assembly:

Here it is after a bit of cleanup.  The heatshrink leaves a nice satin surface finish.

The test piece turned out to be pretty much a complete failure.  First, the epoxy I used did not fully cure.  It's the same batch of epoxy I used on my carbon fiber bike, so I'm not sure what the problem was.  Nick has had lots of problems with this epoxy recently as well.  Also, the epoxy did not bond whatsoever to the ABS plastic.  I was able to cut the carbon fiber and peel it off by hand after letting it sit for 4 days.  I think if I redesign the arm such that pretty much the entire surface can be covered in carbon, the carbon delaminating won't be an issue.

Other thoughts:  The whole assembly is much heavier than I would like.  The aluminum attachment point at the end should be smaller, and the printed walls could be made thinner.  This version was printed with 2 mm thick walls, but thinner would be fine with carbon fiber added.  The plastic serves two purposes, which are to provide a precisely sized mold for the carbon fiber, and interfaces for bearings.  It should not be taking much of the bending load, so the walls can be made as thin as possible.

Also, with newly acquired TechX funding, I've started ordering things like bearings, belts pulleys.  Most of the parts were found on SDP-SI, and then ordered on Ebay for significantly less cost.  To figure out the pulley sizes, I plugged in the moment of inertia figures for my arm CAD model in Solidworks to my gear ratio-optimizing script, and then found the closest sized pulleys I could actually buy.  Rather than using the single extremely large tooth-count pulley recommended by the script, which I would have to machine myself and would be awkwardly large in diameter, I have two-stage reductions with smaller pulleys.

The relevant moment of inertia

Here's a render of the partially-CADed belt reduction

The other robot-arm progress I've made is translating my Python optimization script over to MATLAB.  This was an exercise in using MATLAB, a way to double check my work, a faster alternative to my Python script, and a way to generate better plots.  To check that my extremely simple Python ODE integrator worked, I compared the results it got with the results generated by integrating the equations of motion with ODE45 in MATLAB.

On the left is the MATLAB result, and on the right the Python result with step size decreasing by a factor of 10 each time.

And a comparison of the charts generated:

The MATLAB code can be found here.

October 12, 2013

A Really Really Fast Robot Arm

Since I started working in the cheetah robot lab, I've wanted to build a high-speed robot arm using a similar low-inertia, composite construction as used on the cheetah legs.

The arm will be roughly SCARA configuration.  Rather than having a motor directly at each joint, both the motors will be located at the shoulder of the arm, and the arms second link will be driven with a linkage.  This will make the arm light and low inertia, so it can be moved back and forth quickly.

I got some excellent motors for the arm from Charles at Swapfest.  They're a pair of ServoDisc Platinum UD9-E.  They have built in optical encoders, and because they're a real part rather than hobby grade equipment, they have an incredibly detailed spec sheet.  The ServoDiscs are coreless axial flux DC motors.  So basically a mini brushed etek.  Since the rotor is just copper windings, without any steel laminations, so there's zero cogging and very low rotor inertia, which make for extremely fast response.

To make the arm as fast as possible, I wrote some code to optimize the tip speed of the second segment of the arm over the gear ratio - arm length space.  Since I'm taking How To Matlab 2.086 this term, I took this opportunity to apply what I was learning in the class just write it in Python using ScyPi.

The main thing I 'd like to change about the code at this point is to implement one of the actual built-in ODE integrating functions.  Rather than figuring out how to use the stock ones I just used my own extremely simple fixed-timestep integrator.  It works fine, but it is pretty slow if you want good output resolution.

Since I know the basic construction method I would use for the arm as well as the motor specs, I was able to model the arm pretty easily.  The model arm is a 1.5" diameter carbon fiber tube I found the mass per length number for online, with a 70 gram mass at the end of it.  The arm is attached to an aluminum HTD timing belt pulley, which is described as an aluminum disc.  For a given arm length and pulley size, you can easily find the moment of inertia of the arm about its rotation point.  From there, you can use the torque-speed curve of the motor to get an expression for angular acceleration of the arm.

The code simulates the arm starting from standstill and applies constant voltage to the motor until a specified change in arm angle is reached (I've been using between 30 and 90 degrees).  Then the average speed of the tip of the arm over the motion can be found.  To get an idea of what ratios/lengths are optimal, you just repeat this process over a bunch of arm lengths and gear ratios.

Here's the Python code:

from math import *
import scipy
from mpl_toolkits.mplot3d.axes3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np

def IntegrateArm(theta0, dtheta0, timestep, thetaEnd, L, Ta):
    time = 0
    theta = theta0
    dottheta = dtheta0    
    ########### Define Physical Properties ###########

    Kt = .081               #Motor torque constant in N-m/Amp
    V = 30.0                #Motor supply voltage
    R = .85                 #Motor terminal resistance in ohms
    L = L                   #Length of arm in m
    M = .07                 #Mass of end-effector in kg
    Ta = Ta                 #Arm pulley teeth
    Tm = 20.0               #Motor pulley teeth
    Rp = Ta*0.7958/1000     #Arm pulley radius in m, assuming HTD 5mm belt
    Ml = .164               #Linear density of arm in kg/m
    ########### Define Body Properties ###########
    Ma = L*Ml               #Mass of arm in kg
    Mp = 2700*.005*pi*Rp**2 #Approximate mass of pulley in kg (modeled as aluminum disc)
    Ia = (Ma*L**2)/3        #Moment of Inertia of Arm
    Im = M*L**2             #Moment of Inertia of end effector
    Ip = (Mp*Rp**2)/2       #Moment of inertia of pulley
    I = Ia + Im + Ip        #Total arm moment of inertia
    ########### Equation of Motion ###########
    tau = Kt*(V - Kt*dottheta*(Ta/Tm))/R   #Torque at motor shaft in N-m
    ddottheta = (tau*(Ta/Tm))/I

    while theta < thetaEnd:
        dottheta += ddottheta*timestep
        theta +=dottheta*timestep
        time += timestep
        tau = Kt*(V - Kt*dottheta*(Ta/Tm))/R   #Torque at motor shaft in N-m
        ddottheta = (tau*(Ta/Tm))/I
    V_avg = thetaEnd*L/time        
    return V_avg                                #Average arm tip velcity in m/s

def plotSurface(Lmin, Lmax, Tmin, Tmax, thetaInt):
    fig = plt.figure()
    ax = fig.gca(projection='3d')
    x = np.linspace(Lmin, Lmax, 100)
    y = np.arange(Tmin, Tmax, 1.0)
    X, Y = np.meshgrid(x, y)
    z = np.zeros([len(x), len(y)])
    for L in range(len(x)):
        for T in range(len(y)):
            V = IntegrateArm(0, 0, 1e-4, thetaInt, x[L], y[T])
            z[L][T] = V

    ax.contour(X, Y, z.T)
    surf = ax.plot_surface(X, Y, z.T, rstride=1, cstride=1, cmap=cm.coolwarm,linewidth=0, antialiased=False)

def findBestGear(L, Tmin, Tmax, thetaInt):
    T = np.arange(Tmin, Tmax, 1.0)
    V = []
    for i in range(len(T)):
        val =IntegrateArm(0, 0, 1e-4, thetaInt, L, T[i])
    return t[V.index(max(V))]

The plotSurface function generates a nice 3D picture of the tip velocity vs number of pulley teeth on the arm and arm length:

Unfortunately there doesn't seem to be any global maximum.  If you keep increasing gear ratio and arm length, average tip-speed keeps on increasing.  However, for a given arm length and arm swing angle, there is clearly an optimal gear ratio.  Once I start actually designing parts, I can refine the model with more accurate arm inertias, but this gives me a good starting point.

Finally, I contacted NAC Harmonic, and they're sending me (for free!)  a 50:1 harmonic drive component set, which may or may not be used in the arm.

September 28, 2013

Finishing up the Giant Scooter

Getting the scooter to a nearly-finished state from its previous condition took a few nights of solid work.  Most of the work was done in the days leading up to the New York Maker Faire.

Last update, the scooter was basically a rolling frame.  To interface the old adjustable steering column with the motorcycle fork crown, I had to make a clamping shim to adapt the tube diameters.

To get the scooter moving on its own power, the only things to do were build a deck and battery compartment, and wire together all the electronics.

The top and bottom of the deck and battery compartment were bandsawed out of 1/8" aluminum plate.

Waterjets are for sissies
The sides of the compartment were bent from 3" wide strips of thick black acrylic.  Using acrylic turned out to be a mistake, as later one of the panels cracked.  Bends were made by clamping an aluminum plate on each side of the bend line, and heating the bend area with a heatgun.

The battery compartment fits beneath the deck and extends to the same depth as the gearbox.  Unloaded the scooter has over a foot of clearance.  The acrylic was edge tapped and fixed into place with stainless screws countersunk into the aluminum deck and underplate.

Wiring the battery pack was a bit of a mess for a few reasons.  First, I didn't leave all that much space in the battery compartment for wires.  Also, this battery pack is a funny creature: while the scooter is running, it's a 16S2P pack, for ~60V, 10Ah.  However, I don't have a 16S charger.  For charging, the pack is split into four 4S modules, which can be charged in parallel.  I needed some sort of external connector for switching the pack between charge configuration and drive configuration.

The HobbyKing hardcase LiPo bricks were fastened down with 3D-printed clamps:

This mess of wires occurred.  Without some 10 gauge Turnigy Noodle Wire this would have not been possible:

The series/parallel switching comes from these four XT90 connectors.  The boat power switch was pulled off a box of servo drives found at a lab cleanout.

Some wiring detail.  Note the gratuitous use of zip ties.

Wiring was finished at roughly 2 in the morning the day of Maker Faire, so I didn't have a chance to attach the brake caliper.  Fortunately, despite the lack of brakes, nobody was run over.

When I got back, I attached the brake caliper.  All it took was milling a funnily shaped bracket thing that screwed into the swingarm:

I still need to pocket the swingarm, because there's just too much solid metal there:

And here's the (mostly) finished scooter:  If you look closely at the fork, you'll notice that there's now a shock absorber on the outside of the fork.  I had two of the shock absorbers I originally used, so to make the fork a bit stiffer I just added the second in parallel to the first.  It's not the most elegant solution, but it vastly improves the rideability.

For reference, here's the original scooter.  Pretty neat how much of a difference one year can make.

Riding this thing is wonderful.  There was a big grassy field with a hill along one edge that I got to do some off-roading on.  The suspension smooths out the terrain extremely well.  Also, the torque is absurd.  I have the Kelly controller limited to 100 amps (out of 200 max) to avoid toasting the magmotors, and use a moderate amount of smoothing on the throttle.  This makes the vehicle a little tamer at low speeds, but if you open the throttle past ~30% it can easily pull a wheelie or throw you off.  The magmotors also seem much happier than the CIMs were.  They barely get warm in situations where the CIM's got too hot to touch.

So, that's a wrap.  My next project, which is mentally in the works, is not vehicle related for a change.  But don't worry, it has shiny motors.