2013-04-07

Electric Vehicle Part II: Frame Built

So the frame of the vehicle when last discussed was a highly non-structural frame with a seat some wheels and a motor. This is it now:


A much more structural thingy with a base board and supports and hot damn it even has a chain to transfer power. This thing is almost usable. All of the making the fork and headset and such happened of the course of a few months of off and on work. The making it structural bit happened in about two weeks of more dedicated work. This thing has existed too long in a semi constructed shape, hopefully it will be done soon; or at least rideable its hard to say when a project is done because then the mods and shiny bits start getting added.

 How ever on that note time to talk about structure a lot of the 80/20 carts made at MITERS have been planar creations supported by the sheer shear strength of the aluminum beams they sat on.  Since this bike/EV/thing is like 1.5m long and made out of 20mm 80/20 bars that wasn't going to fly. What the vehicle really needed was a larger moment of inertia to prevent flexing in the middle. This was achieved through the angular braces that form a bridge like structure under the seat. The ends of this bridge structure sit on horizontal bars that are fixed in between 1/4" plates this provides a solid base near the ends of the scooter. Unfortunately this meant the 80/20 had to connect at strange angles, this required bent brackets to accommodate the angles needed by the supports.

Rear brackets
Here is a picture of a bent and yet to be bent pair ofrear brackets. The aluminum is 1/8" thick and for size reference the holes are 20mm apart and fit M5 screws. That also gives a reference for the wrench in the next picture as a poor-man's brake. It is fucking huge. It is around 2' long and provides an excellent lever arm.
Each bracket was bent in small increments deforming one section at a time along the bend line. Despite the inaccurate method the brackets fit in place pretty well. Some brackets which needed larger angles were heated with a torch before bending this made it significantly easier to bend some of the brackets without ruining the intergrity of the metal(...well maybe its temper was ruined but w/e).

Whats was actually more obnoxious than the bending was cutting some of the 80/20 sections. Distinctly the braces on the rear of the vehicle. In order to provide natural support for the braces (both in the front and in the back) they were cut with a niche in the bottom so they could rest on top of the the brackets and supports on the frame base. Due to the odd 3-D angles getting the interface was a pain without using a mill but since I wanted to get this done quickly and precision was not a requirement the joints were band sawed then filed a bit.

Etched cut to make

Left: Cut Just made by bandsaw, chunk barely held in Right: mirror support without chunk of aluminum in place.

Yes that cut looks weird but that is actually how its supposed to be. When viewed from the proper angle it is just a 90 degree cut out like this:
Support bar from a less confusing angle
The angle in the end of each support fits over the edge bar or bracket it connects to, this way when some one is sitting on the scooter and these bars are loaded in compression and they transfer the forces more directly to the structural objects they sit on rather than the brackets that keep them in place. It also means I don't have to worry about them becoming displaced as easily   Either way not very exciting yadd yadda, after attaching the additional supports and what not the electric vehicle was quite solid. After the supports a large sheet of 1/2" plastic(it might be HDPE) that I found was fixed to the base. These steps are kind of boring and I'll skip posting more about the structure of this thing. It's a frame in the shape of a bike/scooter. The next discussion will be about the drive train/energy storage of the scooter.

Also holy crap I'm tired of referring the 'the electric vehicle' as a scooter , EV, minibike. From now on it shall be known as busscooter because it is long like bus and according to some people will have the turning radius of a bus....which is not entirely inaccurate given its length.


2013-04-06

Electric Vehicle coming along Part I


So in the mean time of not posting I've been making an electric vehicle for small motor.

It kind of like a minibike..ish. Its been called a skate board crossed with a scooter among various other things, but nothing seems to describe it right. Either way its coming along and its about time for the post of the project. To start off here's the (partially incomplete because I'm lazy) cad model of the project:



Despite being incomplete the vehicle is pretty much the same shape as the cad model. However there were several changes to the structure of the vehicle that were just done on the fly. Namely all the additional supports besides the vertical posts holding the seat up. But I'll get to that in the next post.

The bike was meant to be ridden in the 'superman' position. This vehicle really borrows a lot from other vehicles that have been produced by other people at miters, hence the 80-20 frame. However unlike most of the other 80/20 vehicles that seem to get made the mini bike will be non planar. Partially because the 80-20 extrusions are too thin with out more support (20mm metric is being used rather than 1").
In retrospect it was a bad decision to use 20mm framing for this, not because it is skinny but because the 20mm 80/20 on mcmaster carr uses M5 nuts/screws and its difficult to find M5 tabbed weld nuts of the proper dimensions (at least in quantities less than several thousand) which forces you to buy the expensive proprietary ones actually meant for the framing. If it had been made with 25 or 30 mm extrusion the frame would have been quite heavier not to mention more expensive but the price difference might have been compensated for if I was to using generic nuts.

Time to go over the construction of the vehicle:

One of the first things to do for the vehicle was to figure out the steering for the project. The wheels picked out were unfortunately too wide for a standard bike fork. So a fork was made out of a bike The tubes were roughly cut then milled to the proper angle and size. Then roughly fit together and welded


Partially machined tubes



Machined tubes fit being fit together and the welded fork.

 After welding the main portion of the fork together some steel plugs were turned and cut to fit into the ends of the fork. These were welded into the fork and will hold the shaft/wheel assembly.

Steel plugs inserted into fork
The plugs were then welded in place then flats were milled onto the sides and a 1/2" bit was drilled through for the shaft which is also 1/2". 

Fork awkwardly clamped down ready to get its flats
Note: the welds were ground down because they looked ugly. The welds seem solid though, after attempting to break them several times unsuccessfully, they're expected to be strong enough to hold a mildly obese person.

plugs with holes going though fork
A chunk of steel was turned down to act as the fork crown and support the bottom bearing of the headset and the bearings were press fit into the head tube.

Ghetto step welded on now the Y of the fork is a complete mass of ground down  weldedness
Next step was to make a method of attaching the head tube to the rest of the frame. 
I kinda winged it and welded  some 1/8" steel U-channel to make an attachmenty thingma dig, it takes x2 M8 bolts in the bottom to hold it on the front brace of the rest of the frame. Here is the head set/fork mounted on the frame base:
It was a giant floppy mass at this point but I get into the rest of the structural details later.

Those little orange wheels were obtained from harbor freight for a disturbingly cheap price of like $8.50 a piece. They came with a matching pair of disturbingly crappy bearings; after watching someone else using the same wheel destroy their bearings, I decided it would be best to preemptively swap them out for a better set.

 The old bearings were removed and a spacer was placed in the center of the wheel that would hold a bearing on either side. The new bearings were then press fit in up to their retaining rings, but the spacer was over sized slightly to make sure that it would contact both inner bearing races.



Turning down one of the spacers.


Spacer next to bearing
Bearing on spacer
Spacer and bearing in hub of wheel
The in-hub spacers remove axial loading on the inner bearing races.This allows the wheels to be tightened in place without stressing the bearings in a bad way (these were normal roller bearings not meant for high axial loading) as well as transfer axial forces to both bearings at the same time. Here is a ghetto mspaint illustration of the hub/bearing assembly:

The hub spacer forms a bridge between the two hub bearings effectively making a solid column, making sure that both of the inner bearing races are supported at the same time.

The next step was to actually get handles bars on the bike by making the bike stem. In the course of this the main thing learned was that the bike stem was not called the 'handle bar holder'.
Started with a large chunk of aluminum

Drilled some holes for a flexture clamp to hold the handle bars and reamed a larger hole to take the top of the bike fork

Repeated process on the other side of the block but drilled holes for  the clamp of the fork and drilled a larger hole to hold the handle bars. Then the front was rounded while being held very awkwardly (read: improperly) in an indexing head note: I would highly recommend against doing this for various reasons. The stem was sanded a bit afterward so it didn't look like it'd been chewed on by an angry aluminum hungry dog.
The rounding was kind of a pain in the ass so on the other side the corners were milled off at 45 degree angles .
Also note the larger holes were slit on one side using a band saw, the slits are roughly 1mm wide but it seems to be plenty of room to get effective clamping force.


The complete stem installed, a homemade cap was installed to connect to the star nut in the top of the fork
Bike with temporary handle bars installed... it also grew a seat and a motor in this picture but we can talk about that later.

Yay it's finally a rolling frame. But it has no support structure and I would not bet it on holding any one with that skinny 20mm 80/20 frame. This part actually posed some annoying requirements since 80/20 framing really doesn't do angles well unless you make your own brackets for it. It probably would have taken less time to learn to weld aluminum and put the frame together at this point each joint has too many nuts and screws it both seems annoying inelegant and pain in the ass to make. That being said this post
 feels really long so talking about how this flat floppy frame was made structural will be talked about in part II  of this post.


2013-02-25

winding pattern generator:

finally wrote the winding pattern generator for an arbitrary number of phases, source:
winding pattern generator
It was written in python 3.x so you'll need to run it. It out put the phase as a number and the direction of the winding as the sign. If any of you end up using it, it would be awesome to hear suggestions, or added features or what you might like to see next.

But yeah so this is that motor winder thing I was talking about, it was accidentally lost while playikng the game of musical partions while reinstalling things on the laptop.
But I rewrote it! and here is.
It gives you a winding pattern for a n-phase, m-pole and k*2 pole motor. If you're too lazy to open up the code to look at it, here's the most important part of it:


def pattern_gin(slot_edeg, phase_slice):
 
    phase = m.floor((slot_edeg % 180)/ phase_slice)#actually calculates the phase for the slot

    if (phase % 2 == 0):#dictates the direction of each winding
        if slot_edeg >= 180:
            phase_sign = '+'
        else:
            phase_sign = '-'
    else:
        if slot_edeg >= 180:
            phase_sign = '-'
        else:
            phase_sign = '+'
    return phase_sign, phase

This is the function that defines the phase and direction of a winding on one stator tooth.
As the input it takes the electrical degree position and the electrical degrees of each phase and matches them up...its really not that exciting.

I've been learning haskell and I'm considering making some sort of simulator

2013-01-19

Long time no see

So hello again. Thought it was past time to make another post.
Current projects that have been happening/ happened are:
-A motor winding pattern generator for an arbitrary  number of phases.
It was written in python and was made in a fairly awkward form, but I ended up deleting some of it in frustration while rewriting it.

Idea behind a pattern generator for a motor:
A permanent magnet motor consists of magnets and solenoids in some circular configuration. In order to produce torque the solenoids must be turned on when they are in the proper position. This is where the winding pattern generator comes in it creates the winding 'pattern' so that when voltage is applied to any particular phase of the motor each pole on that phase produces a force in the same direction  this goes back to one of my last posts when I made a motor. This bring about babble of electrical angles which I talked about for a moment in this post. 2pi rads of electrical angle per pair of magnet poles (or you can think about it in degrees if you like), this gives a whole crap load of radians per motor but since our magnets are tessellate (positive pole up, then negative, then positive.....repeat) we really only care about how things line up within a single 2pi rads interval. So when talking about electrical angles it is useful to think of them as electrical angle mod(2pi), I kind of like to think of it as walking off the right edge of a TV screen and coming back on the left side.


This makes things easier to count and think about positionaly and bring up the question:
When do we actually want to turn on a phase?
And depending on what the goal iswant to do that answer can actually not be that straight forward. However in most cases you probably only care about getting maximum torque out of your motor. In order to produce the maximum amount of torque you want to turn your motor on when it is directly between the pole of two magnets.

This corresponds to an angle of either 0 or pi depending how you want to look at it. So how do you get all of your poles in one phase to produce torque in the same direction? By applying voltage to all of the poles in a certain interval at the same time. Ideally all of the poles in the phase would be at the same electrical angle when turned on. This ensures that they all push in the same direction.  By defining a certain window of electrical degrees where sum((nth pole torque) for 0 to n poles)>0 at all times in that interval. i.e. the motor will always be pushing in the same direction.

This pattern can be calculated without too much work below is some fake code I wrote to calculate the winding pattern for an arbitrary phase motor of n even poles, and an arbitrary number of slots.
Please forgive the bastardization of code, it was really an organizational exercise to make sure the motor winder is written properly next time it gets written...hopefully this is not too nonsensical looking.

Psuedo code for motor winder:
#pretend the person already entered the number of poles, number of phases and number of slots(stator poles) and they make physical sense:
pole_num
phase_num
slot_num

#find the amount of electrical degrees to alot to each phase interval
#and the electrical degrees per slot
phase_slice = 180 / phase_num
slot_slice = pole_num * 180 /slot_num

#map the values out over all the slots and phases so you have each phase interval
#and the electrical and of each slot
slot_angles = map(lambda(n): (n * slot_slice) % 360): range(slot_num))
#phase intervals mapping not needed but good to look at sometimes to make sure everything makes sense
#phase_intervals = map(lambda(n): ( n * phase_slice) % 180):  range(phase_num))

#this is the heart of the program it decides the phase number and the direction in which to wind each phase slot

defun pattern_picker (slot_angle[n], phase_slice)(
    #makes and integer of each slot corresponding to the phase interval it lies on
    phase = floor(slot_angle[n] % 180 /phase_slice)
 
    #decides the direction of each slot winding on the stator
    (if even?(slot_angles[n])
   then (if (slot_angle[n] > 180)
       then (case = "-") else(case = "+")))
    (if odd?(slot_angles[n])
    then (if (slot_angles[n] > 180)
       then (case = "+") else(case = "-")))

#outputs the direction and phase for a given stator slot
return( string(case)+string(phase))

#gets the direction/phase for each slot
winding_pattern = map(pattern_picker(slot_angles[n], phase_slice): slot_angles, repeat(phase_slice))

print("Behold! Your winding pattern sir: \n")
for slot in range(len(slots)):
(if (slot != len(slots)) then (print(winding_pattern[slot] + ", ")
    else (print(winding_pattern[slot] + "... the end"))


I'll babble more about this later and potentially post some code which will actually calculate a winding pattern.

Edit: I tweaked the code upon realizing I made a few mistakes in the pattern picker funtion with regards to the variables being passed in as well as the definition of the phase number.

2012-05-30

Long story short I got swallowed up this school year and not much got done on a projects front. It was really en escapade of screwing  up in some respects from a project stand point which can be gotten into later.

Things that did happen:
-made a generator (read: BLDC motor) for a class, which was really a rework of an existing generator, really the only reason parts of the old generator were used was because its stator was the right dimensions. But its rotor was remade and the stator was rewound and hall effect sensors were added. It was rewound at 50RPM/V, the target was ~100RPM/V; but because I can't do math that didn't quite turn out. Pretty much lesson here is  the average voltage of a rectified 3phase is not the same as the average value of a rectified sine wave... and don't do math at 3am. luckily in the. many thanks to alex and erich in helping getting the rotor machined.
shiny insides

less shiny generator outsides
Stator before rewind
Stator after rewind/adding sensors
Another project was a tool post holder for the lathe/mill combo thingy that was acquired a while ago. The 'millathe' is Maximat7 made in Austria god knows how long ago and probably weighs close to 75kg
tool post sitting on tool post holder it looks like a zebra because  the mill spindle wasn't level and i was too lazy to change it, I like to consider this a stylistic plus.
the failgatedrivetroller was supposed to be a gate driver board for a 3 phase bridge
failgatedrivecontroller has 2 mistakes: mirrored to arduino pinout and forgot the all important ground
The horrible mezzanine thing was made to swap the pinout of the arduino.

Long story short there's been a good amount of fail in recent projects due to messing up details. Devils always is in the details but this leaves rooms for revisions and what not. Considering the pain it is to make boards I'll probably transition to getting boards fabricated by a third party and using a lot more surface mount components. DIL packages have been getting a bit old and clunky and it would be nice to have sexy well done boards with less errors than I would make.

Either way that's whats been happening over the lat few months and I'm going to start a new post to separate this post from a more technical one and shall be babbling about motors among other things.

2011-10-23

Things getting done: The beginning of Big Motor

I unfortunately have other things to do than post on the internet but I feel obligated to update this every once in a while so for the maybe one or two people who stumble here by accident so please sit down and enjoy the beginnings of Big Motor (the motor that will supersede small motor). For a scale reference on this motor the air gap OD is 10.5" and the magnets are doubled up to for super poles with 2 magnets per pole, making this a 30 pole 36 slot machine. The model isn't fully done yet, I'm still deciding if I want to attempt getting a second stator of the same type and doing a transverse flux concentrating geometry to avoid magnet reluctance. The attempted result would be a ridiculously high flux linkage and by ridiculous, that is to say something that would just almost saturate the iron with a few 2-5mm of air gap. The operating goal of this linkage would be 1. High torque for low current (hence avoiding magnet reluctance) 2. Avoiding higher harmonics of eddy current losses induced by quickly changing back emf from the magnets (taken care of by the larger air gap). Since these goals are directly at odds with one another some FEMM simulations will be under way to see how achievable this will be. Either way enjoy the picture its Big Motors initial design without any fancy pants transversefluxyness (note: the model isnt done yet).

Big Motor....its big

2011-10-03

Power Supply and Vehicle Update

I have been quite busy with school so I'm just going to post some pretty pictures of some of the progress made towards the electric vehicle and power supply. First off here is the transformer. Because I wanted to experiment it is made of a pair of toroids. It is litzed  because this will be run at ~300kHz min making skin depth and eddy currents an issue. The turns ratio is 4:1 and its meant to operate at 120VRMS on the primary side drawing around 10A minimum.
just the primary
with the secondary

The wire is the same stuff used on my motor, its nice because the low gauge makes winding easy, however it has a gnarly polyamideimide coating with astoundingly good mechanical and electrical characteristics coating which much to my chagrin cannot be burned off in a solder pot or removed with standard solvents such as acetone. The easiest ways of removing the coating without a sketchy solvent seems to be sand paper (labor intensive) or propane (not the neatest). At the moment torching it is easiest despite the bits of semi scorched insulation it leaves behind. However to stop the thermal gradient from crawling up the wires and leaving a bunch of damaged insulation I recommend covering the wires in a wet paper towel up to where you want the insulation gone.

On the mechanical side of things I hacked apart a pair of bike frames to be used in the electric vehicle.

Initial bike frame
It is amazing how much less space a bike takes up once it has been reduced to a pile of tubes; even more amazing is the destructive power of a sawzall on a bike frame.

A pair of bikes that were attacked by a sawzall
Next step in this process is to strip the paint from the tubes so they can be cut up and welded together. To strip the paint I got some paint removal discs; they kind of make me think  a brillo pad and bunch of sanding discs tried to have kids. However after trying them out, the process is a bit more labor intensive than I want it to be and so I might resort to chemical methods.
....however work needs to get done so until next time.