April 19, 2015

The Longboard Has Gone Too Long Without a Motor

As previously indicated,  my longboard (can it be called that?  It's tiny) recently sprouted a battery pack and motor.

I started out with this board.  Nick crufted the deck out of a dumpster a while back, and I got an extremely cheap set of wheels and trucks for it.  The construction is interesting.  The deck is made from a 1/8" thick sheet of wood laminated on each side with a very thin layer of aluminum.  The resulting deck is extremely light and flexible, which makes the board really smooth out bumps (which are rather abundant on Cambridge roads and sidewalks).

Most electric longboards out there are stiff, because you generally don't want your batteries and electronics bending.  Alternatively, some electric boards have a small battery at one end, motor and controller at the other end, and nothing in the middle, allowing the board to be flexible.  This requires a full-sized longboard and/or a small battery though.  I wanted to keep the flexibility of this board, even though to get reasonable range the entire underside would need to be packed with battery.

My solution was the bendypack, which is the only part of this build that's anything new.  The rest of the electrical system is typical diy-electric longboard stuff, with a HobbyKing motor, motor controller, and remote control system.

The key to the flexible battery pack is its corrugated enclosure.  The corrugations allow the pack to flex at the gaps between rows of cells.  The inter-cell connections run against the deck, which is very close to the neutral bending axis of the board and battery assembly.  This means that the wires barely have to stretch as the pack flexes.

To make the corrugated casing, I cnc milled a foam mold on the MITERS cnc mill.

The mold was milled in three parts, because of the size limitation of the mill:

Two layers of fiberglass were vacuum bagged over the mold:

The foam was dissolved out with acetone. It left some color behind though:

The case fits 18 26650 A123 26650 cells.  These are arranged in a 6s3p configuration, for a nominal 19.8 volt, 6.6 amp hour pack.

Cells were soldered together with grounding strap to minimize the thickness of the connections:

The pack was insulated from the deck with a sheet of rubber.  Around the edge is a much softer synthetic foam, to act like a gasket and seal off the pack against the bottom of the deck.

The pack was screwed to the deck with a bunch of 2-56 screws around its perimeter.  These screws were tapped directly into the bottom of the deck.  The material of the casing is very thin, so the screw heads alone would have pulled through the fiberglass.  I 3d printed a series of oddly-shaped washers which were glued to the casing to distribute the load.  The washers aren't shown here:

The motor-wheel-pulley system is nothing special.  The 42 tooth HTD-5mm pulley on the back wheel was downloaded from this thread on endless-sphere and 3d printed.  Sounds a bit sketchy, but there are 6 M5 bolts going through it to hold the wheel hub, and the load is spread across a bunch of teeth.

The motor pulley was CNC milled out of some square 7075 bar stock:

I much prefer split collar style clamping mechanisms to set screws, so I manually machined some slots in the pulley, and drilled and tapped a hole for the clamping screw.

The super cheap trucks had no square faces or cylindrical surfaces, so I stuck if in the lathe and turned a small section down.  We don't have a steady rest for the MITERS lathe, so I used the old drill chuck, which has smooth jaws, with lots of oil:

I CNC milled a two-part motor mount, with about a centimeter of adjustment room for tensioning the drive belt:

The mount was temporarily fixed in place with a big set screw, and tack welded to the truck by Mike.

I shoved an RC airplane controller (160 Amp dlux HV) and rc receiver into a 3d printed case, and glued that to the battery pack.  I don't really want this to be the permanent solution, but it works well enough that I probably won't change it until something breaks

Right now the "switch" is just the battery's deans connector.  Also not ideal, and it will get replaced with a proper switch eventually.

Belly up:

The board is geared for a no-load top speed of just over 22 mph, so realistically can probably get to about 20.  I very rarely max it out though.  I haven't measured the range exactly, but I'd estimate it at 7 or 8 miles, although this will depend on how hilly and windy it is.  Riding back and forth from East Campus to MITERS 3 times (.7 miles each way) drained about 3.5 amp hours from the battery pack.

March 29, 2015


A new innovation in silly electric vehicle battery technology:

More to come soon.

March 11, 2015

New Cross Slide

Since I only have one of the original taig cross slides, but want both a cross slide and compound on the mini lathe, I had to make a new cross slide from scratch.  Also, since the little ballscrews I'm using are right-handed, rather than left-handed like cross feed leadscrews normally are, the whole system has to be rethought a bit.  To get the correct motion, the handwheel that moves the cross slide will be fixed to the cross slide, rather than the carriage.  Basically the same way compounds are normally set up.

As with most projects, I started out with a nice brick of aluminum.  The original cross slide is on top for reference:

It's significantly bigger than the original for a couple reasons.  First, by mounting the handwheel on the cross slide, you lose travel distance towards the spindle, since the hand wheel would collide with the carriage.  Also, I just wanted a bit more travel than a stock Taig has.

Why isn't it steel, or better yet, cast iron?  Well, aluminum was good enough for Taig... I may try hard-anodizing it like the original to improve its wear resistance.  Also I don't have any cast iron bricks lying around.

I faced the brick to size, and cut a strip of brass to make a gib from.  The bar I cut from had some nasty internal stresses, so the piece warped like crazy when I slit it off.  I was able to machine it down to size and get rid of the warp, though:

Here's the squarely-milled jib and cross slide.  A few holes were drilled and tapped to fix the two together, and then I milled the dovetails:

Preparing to mill the dovetails:

Turned out pretty nicely.  Tapped holes along the side were added for adjusting the gib.

I lapped the surface the same way as last time to get it to slide smoothly:

Next episode, I'll be adding the ballscrew and hand wheel to the cross slide.

March 1, 2015

Taig Mini Lathe

Back over the summer, while exploring some dusty top shelves at MITERS, I found what appeared to be they ways, carriage, and cross slide from a tiny lathe.  No one seemed to recognize them (and they were covered in a healthy layer of dust), so I claimed the parts as my own.  The steel dovetail ways were a bit rusty, but everything seemed in good shape otherwise.

The design of this thing is unusual.  The tailstock is lever-actuated, the carriage is cast aluminum with machined surfaces, and the cross slide looks like an anodized aluminum extrusion.

While looking at shiny machined things on some corner of the internet, I found a photo of a workpiece in a small lathe, and I recognized the distinct carriage and way assembly.  Elsewhere on the site, the lathe was identified as a Taig machine.  Turns out there's a pretty large community of people who use (and heavily modify) these machines.  Here's an example of a blog dedicated Taig mill and lathe projects.  

All the parts for the lathe are readily purchasable, and they are actually really reasonably priced.  But that would be no fun, so I'm going to basically build everything from scratch.  My basic plans are:

  • Make it metric!  Why?  Because metric is great, and I also happen to have a pair of sweet 1mm pitch metric ball screws I'll be using on the cross slide and the compound.  I haven't yet figured out the carriage rack situation though.  
  • Make a headstock and spindle.
  • Make a chuck from scratch.  Depending on how adventurous I'm feeling I may make both an independent 4-jaw (definitely easier to make) or a 3-jaw scroll chuck.
  • Brushless motor drive.  I'm deciding between a SK3 and a fancy Moog inrunner I have lying around.  The Moog will be quieter and shinier, but is definitely less power dense.
  • Make a new cross slide, and turn the old one into a compound slide.
  • Add a leadscrew for the carriage, for at least one speed of auto feed.  I don't care about threading, but a slow auto feed speed for finishing passes would be nice.
  • Make a mini quick change toolpost.

To start out, I removed most of the rust with steel wool, and then lapped the ways with oil and fine polishing compound.

In the next episode, I'll make a new cross slide, and ball screw couple it to the carriage.

February 15, 2015

Finishing Up the Coreless Motor

First, some photos taken with one of Bayley's magical cameras:

Sorry I didn't focus it well enough to achieve the full 25 megapixels of resolution, Bayley

After last round, the only thing left to make was a ring to separate the two halves of the rotor.   I CNC milled these two rings out of solid 10mm plate, using a 1/8" carbide endmill.  (Very) Subtractive manufacturing for the win.

As you can see here, I really didn't leave much clearance room around the stator.  If I had made the motor any bigger, however, it would have been too large to machine on the MITERS CNC mill, which is limited to 7" of Y-axis travel.

A problem with the stacked-parallel-plates construction is that it is really hard to actually get the stacked plates completely parallel.  I spent way too long trying to get rid of the little bit of skew between the two halves of the rotor.  I was able to make it acceptable, but not nearly as perfect as I would have liked.

As predicted, with both halves of the rotor installed, the circulating-current drag I noticed before disappears.  Here's the motor spinning up at 24 V on a generic hobbyking airplane controller:

At full speed on 24 volts, the motor draws 2.4 amps.  Not too bad, really.  The spin-down time is satisfyingly long as well.  

Drill-scoping across the leads put the motor at 97 rpm/volt, which is a bit higher than I expected.  Maybe the lost torque constant comes from my modeling of the motor about its average radius, or the magnets being a bit weaker than FEMM thought.  Still, not too bad for a first try.  If I could figure out how to easily wind it with wire, moving to a more Servodisc-style winding pattern could give a pretty decent bump in torque constant while still allowing the stator to be constant thickness.

Line-to line resistance is 100 mΩ, or 50 mΩ per phase.  So in terms of motor constant (Kt/√resistance), this thing comes a bit ahead of the venerable 80-100 "Melon" airplane motor.  I just measured one of the 170 rpm/volt flavor at 50 mΩ line-to line.  Realistically, in its current form it's probably very thermally limited, but this is still a pretty sweet result.  Now I just need to find some derpy vehicle to attach it to.

February 7, 2015

Coreless Axial Flux Motors

I've been thinking about this kind of motor since I started playing with the ServoDisc's for the robot arm.  There are lots of reason I think this particular motor topology is especially cool, and I won't go into all of them.  Near the top of the list, though, is that the disk-like form factor and lack of laminate steel core allow for a lot of flexibility in construction.  This is probably why they're particularly popular with the diy-wind turbine folks.

I'll jump straight into the design, and then go back and justify it.  

Here's a motor:

Here's what the stator looks like.  This winding pattern is fairly incomprehensible from this picture, so I'll explain it more clearly later:

The stator consists of two thin fiberglass disks wound with litz wire, sandwiched on either side of another fiberglass disk, which is bolted to an aluminum hub.

Here's half of the rotor.  The magnet arrangement is a 12 pole-pair, 90 degree halbach array arrangement assembled out of identical .25"x.25"x1" N50 magnets.

And the whole rotor (minus the cylindrical shell between the halves).  Because of halbach array magic, the rotor can be made out of something awesome like carbon fiber, instead of steel.  Honestly, there's little to no weight savings here using carbon fiber over aluminum, but A) carbon fiber is awesome, and B) techx funding is a great excuse to buy fancy materials.

To explain how this thing actually motors, I'll start out by explaining the windings.  I spent a lot of time thinking about how to wind such a motor.  Not being constrained to wind around a laminated steel stator means there are lots of options.  

My first thought was to waterjet three identical winding out of sheets of copper, and epoxy them together 120 electrical degrees out of phase.  Copper sheet windings would allow for variable wire width, so the conductors could get wider as the radius increased.  Also, the end turns would not be constrained to the width of the rest of the winding, so they could be made much fatter.  I knew eddy current loss in the windings would probably be a problem with this design, so I spent lots of time running through different winding geometries in MATLAB to figure out just how bad the losses would be.  Then I gave up with that idea.  

Turns out there's a really cool masters thesis on basically this exact thing.  It's great at very low speed, since the copper fill factor is extremely high, but at any reasonable speed it gets destroyed by eddy current loss in the solid copper conductors.  Also, it's probably the most beautiful set of windings I've ever seen.

Next option is to go the to the other end of the spectrum, and use litz wire to wind the stator.  Extremely fine insulated strands should nearly entirely eliminate eddy current loss in the conductors.  There are a bunch of possible strategies for winding the stator.  Concentrated windings, like Shane's LEAF motor makes winding much easier, but there's a lot of unused space in the stator where copper could go.  To think about winding configurations, I mentally stretched the motor out into a line.  My first thought for a distributed winding pattern looked something like this:

With one phase, it's really easy to see how how the lorentz-force action works:

To make it three phase, just copy and paste that same winding pattern twice, shifting by 120 electrical degrees each time:

Wrapped around into axial-flux, a phase looks like this:

Unsurprisingly, this has been done.  Here's a great example of a stator which appears to be made this way.  There are a few things I don't like about his winding pattern though.  First, there is quite a bit of copper in the end turns (although the end turn to active copper ratio goes down as you add more poles).  Also, the end turns have to overlap each other with three phases, meaning the inner and outer rings of the stator need to be thicker than the active region.

Here's another idea.  Turns go diagonally across each pole, instead of up and over:

That's interesting.  It's pretty intuitive that this winding pattern will have a lower torque constant than the rectangular winding, since each turn overlaps the whole sinusoidal field.  To the first order, I'd expect the peak torque produced by a phase to be lower by a factor of roughly 2/π ((integral from 0 to pi of sin(x)) / (integral from 0 to pi of 1)) However, it also clearly will have lower resistance than the rectangular winding.  Also, there's no end-turn overlap, so stator can be made a constant thickness throughout.  

Just by looking at it, it's not exactly clear whether the lost resistance makes up for the lower torque constant, but it does seem easier to build, so I designed a motor around it and then figured out how it should perform.  Fun fact, it turns out this is pretty much how Faulhaber motors are wound, but those are radial, not axial.  I haven't seen any axial flux motors wound this way.

On to actually analyzing this thing.  First I took a look at the magnet array in FEMM.  I unrolled the motor to a line at its average radius, since FEMM is 2D.  I didn't bother with looking at the entire magnet array, and just simulated a few pole pairs:

The normal flux density around the middle of the airgap looks like this.  Peak normal flux density of around .75 T.  Not too bad for a 10mm gap between magnet surfaces.  Looks pretty sinusoidal, too (ignore the edges).

Now I know what the field looks like.  Rather than doing the rest of the simulation in FEMM, which is certainly possible, I did it in MATLAB because I have little interest in learning how to do FEMM Lua scripting.

My stator is wound for 12 pole pairs, and 5 turns per phase.  However, the turns are evenly distributed about the circumference of the  stator, not concentrated on top of one another.  Stretched out into a line (again), the winding pattern looks like this:

All the turns in a phase are in series with one another.
To figure out things like back EMF and torque constant I took another LEAF (ha!) out of Shane's book.

Method 1: Lorentz Force

The most intuitive way to look at the torque constant is probably doing ILxB on all the wires to find the force on them for a given current, and adding up the wires that correspond to each phase.  This method resulted in a torque constant of .0752 N-m/A for one phase.

Method 2: Looking at Flux Linkage

This was was definitely less intuitive, but produces some more information.  Here's how it works:
  1. Define the shape of one turn of one phase, and define a sinusoidal flux density for a couple pole pairs.  
  2. Integrate the flux density over the area of the turn, for flux linked by one turn of one coil.  
  3. Virtually shift the coil a little bit along the magnets, and repeat the above calculations.  Repeat until the coil has shifted by 2π.
  4. Repeat for each of the 15 coils (5 turns per phase, 3 phases), which are all offset from one another.   This gives the linked flux vs electrical angle of each coil, which looks like this:  
  5. Take the derivative and multiply by an arbitrary electrical frequency.  I used 1256 rad/s, which corresponds to 1000 mechanical rpm with a 12 pole pair motor.  This produces the voltage induced on each winding vs electrical angle.  
  6. Add up the voltages of the coils which are part of the same phase: 
  7. Back EMF constant (Ke) and torque constant (Kt) are equivalent, for a phase Kt of .077 N-m/A.  Hey look, that's basically the same as before!
To see what would happen when wye-terminating the motor, you can subtract two phases from each other, since they are connected in series but joined at the ends:

Wye terminated, I should expect something like .13 N-m/A, or 72.5 RPM/volt.  Seems pretty reasonable.

It's easy to compare skewed vs straight windings this way, also.  For my particular motor geometry, using straight windings gives a 30% boost in torque constant, and a corresponding 30% increase in phase resistance.  So overall, it actually produces a slightly higher performance motor, since motor constant (here defined as Kt/√resistance) is higher.

Actually building this thing:

Most of the motor parts were made on the MITERS CNC mill.  Here's the fancy-looking end cap that joins the rotor to the shaft:

Plates that connect the thin section can bearing to the rotor:

The stator parts were routed out of 1/32" Garolite using a 1/16" carbide endmill borrowed from Nick.  I messed up these parts a few time (trying to fit too many turns on the stator, messing up winding, etc) so I've gotten really fast at making these.  I experimented with a couple methods for fastening the fiberglass to the mill.  I bolted a sheet of masonite to my milling fixture, and adhered the fiberglass using spray adhesive, hot glue, and double sided tape.  In the end, I like the double sided tape the best.

Getting the winding down took a few tries.  The motor was wound with 20x5x38AWG litz wire.  Since litz wire is twisted, when folding the wire around the opposite side of the fiberglass winding form, the wire behaves strangely.  Winding one direction, it bends parallel to the sheet, and the other direction it bends perpendicular to the sheet.  I chose the wrong direction to wind my first one, and it turned out terribly messy as a result.  Next time around I realized winding the other direction would be much easier, and switched.

Here's one phase:

Two phases:

And all three:

I squished the windings in the mill vice to get them nice and flat:

The two stator windings were epoxied together with high temperature epoxy, clamped between two aluminum forms, and baked to cure:

Rotor parts were routed out of .1" carbon fiber sheet using the same 1/8" endmill.  The sheet I used was laminated from unidirectional layers, and the top and bottom edges came out a bit fuzzy:

Filing with a diamond abrasive file cleaned up the edges:

Beginning the magnet array:

All the north-south pairs glued down:

Magnets really don't appreciate being forced into a halbach array, so I stuck a big steel plate on top of the array (with a thin plastic buffer between), and slid the sideways-pointing magnets in from the side, positioning them with a 3d-printed jig:

Everything was then slathered with epoxy and cured:

The steel disk was sheared off by tapping it with a hammer.

The aluminum hub holding the stator was the only component that was manual machining-intensive:

I paralleled the two halves of the stator, wye terminated them, and attached one of the two rotor disks for testing:

Testing was done with a crufted hobbyking sensorless controller.  I first tried with a sketchy ebay chinese e-bike motor controller, but I think the motor was too low inductance, causing the controller's current control loop to misbehave.  Also, a drill-and-scope back EMF test showed a torque constant of .055 N-m/A (175 RPM/volt) with only half of the rotor when wye terminated.  I expected something like .13 N-m/A with the full rotor, so that number is pretty in line with my prediction.

A couple things are apparent.  First, it definitely wants sinusoidal commutation.  Nice and noisy with the hobbyking controller.

Also, the motor displayed astoundingly high loss at high speed.  Just spinning the rotor by hand, it was easy to see how quickly the rotation was damped.  Sounds like eddy current loss.  By chucking the rotor in a drill and spinning it, I could even feel the windings warming.  But wasn't the point of using fancy litz wire to eliminate that?  At first I thought the process of oven-curing the epoxy had destroyed the litz part of the litz wire.  I had set the oven to 120 C, so maybe there was a chance the temperature control loop overshot to 150 C, which would be dangerously hot for the insulation.

I made another stator.  Before epoxying everything, I quickly tested it.  And it displayed the exact same drag as the epoxied-and-baked stator.  So something else was up.  On a hunch, I unparalleled the two halves of the stator from each other.  And the issue disappeared.  Scoping corresponding phases on the two stator windings confirmed my suspicion.  With only one half of the rotor in place, the two halves of the stator experience very different fields from the magnets on the rotor.  Since they were wired in parallel, this caused massive circulating currents between the two halves of the stator, causing the drag that felt like eddy current drag.

Looking at the two curves on the scope screen, the yellow trace is the phase close to the rotor, while the blue one is the phase farther away.  The farther away phase has less than half the voltage induced across it.

I un-terminated the first stator, and confirmed that it was also fine.  Since the problem is due to the asymmetry of the rotor with only half of it installed, the obvious solution is just finishing the motor by adding the other half of the rotor.  The two sets of windings should then be happy and symmetric.  If the loss is still a problem, the solution is to series the two windings instead of paralleling them.  This will make the motor even slower, but should completely fix that loss.

Now I just need to make a ring to separate the two halves of the rotor, so the thin-section bearings don't explode due to the magnetic attraction between the two plates.  And find something silly to stick the motor on.  And build another one, since I've already gone to the trouble of building a second stator.