You may have been wondering where all the updates are on the electric trike are. Unfortunately you’ll have a little while longer to wait as my attentions lately have been focused on a second project, my CNC Router.
Like many an engineer I’ve been fasinated with CNC Routers and Mills since the day I learnt they existed. The things some of the big commercial 5 axis CNC mills can do defy belief, see [this one]. Now I’m not kiding myself, this level of performance requires huge precision and mass to obtain the required rigidity. Precision and mass both equate to big $$. So I’ve settled on something a little more sedate, enter my CNC Router:
The frame will be constructed from welded 65x35x3mm RHS steel. The linear guides are THK SR 25 rail with SW 25W-Y bearings which I lucked upon moments before they were thrown out. In order to actually move things three 1.9Nm stepper motors will drive C7 rolled ball screws, available from my [favourite direct from China store]. The rails and screws are mounted to 10mm thick aluminium plate with the rails on 12mm standoffs. The intention of this is to allow tweaking of the alignment by shimming of the back plates with respect to the frame to make up for my less than stellar welding abilities.
The end result may look simple but it is the result of hundreds of hours of research, thinking and playing around in Solidworks. At first I had intended to make a vertical mill, but came to the conclusion that I wouldn’t be able to make something solid enough within my budget and limited machining resource. I played around with three or four fundamentally different designs before finally settling on a fixed gantry design. This sacrifices work area and ease of construction compared to a moving gantry design, but hopefully with the reward of greater rigidity.
A welded steel frame was chosen over bolted Aluminium (which would have been easier to construct) in order to make the project more affordable and hopefully more rigid. The reason rigidity sat so high on my list is that reading through [cnczone] and [mycncuk] it quickly became apparent that the majority of people who built routers wished they were more rigid, and as my primary goal is to mill aluminium I knew it was important to attack this from the get go.
And then this happened: No sooner had I written the above sentence when I had an idea which may change some of the details in the attached image. I had previously considered using a piece of 20mm thick aluminium for parts of the build but, the lack of access to a mill lead me to abandon those ideas. I just realised (probably because I can be a bit slow at times) that I have a router, I have some linear tracks, surely I can make something to allow me to “mill” straight sections in aluminium, after all the majority of the CNC routers I’ve seen on the net are just using normal wood routers as their spindles. 20 mins out in the garage and I’d proved my point by squaring up a piece of 10mm scrap using nothing but a straight edge (THK track), a wood router, and a straight 2 flute 1/2″ wood router bit.
Two of the edges were already parallel so I just squared up the remaining two edges. The first edge I made ~4mm passes with a 2mm depth of cut (DOC), this worked reasonably well and only required 5 passes to get through the whole 10mm. The second side I tried something I knew would be pushing it a bit and made a single pass removing ~1mm but at the full 10mm DOC. The first edge gave a reasonable though not great finish, certainly good enough to build the router though. The second edge resulted in a lot of chatter and a fairly rough edge. That being said it was nothing I couldn’t fix with a file and 2 minutes.
Other things I learnt from this little experiment:
- 1kW should be sufficient for milling aluminium at a reasonable DOC and feed rate.
- A 2 flute cutter in a 25k rpm router with a 1m/min feed rate seems like a good starting point, though I should actually do the proper calculations to confirm this.
- Swarf gets EVERYWHERE! And by god is there a lot of it. I hadn’t really considered it too much, though it’s become apparent that I’ll need to develop some sort of swarf management system in parallel with the router. And I thought saw dust was bad.
So, watch this space, I’ll be back with an updated, easier to build (though probably more expensive) version of my CNC router soon.
A number of components on my future trike, such as the forks, headset, handle bars, etc, which are conveniently available at low cost in the form of a second hand BMX. After scouring forums and online auction sites for several days I stumbled across the perfect donor.
At the reasonable price of $30, the front end of this “BMX” would make a brilliant start. It even has stunt pegs on the front wheel that I can use as foot pegs!
Once I had the bike home I began ripping into it. The first thing to do was remove all the components which I planned on keeping, but were currently getting in the way, namely the fork, front wheel, and handle bars. I’ve grown up on bikes my entire life, a push bike was my sole form of transport until I was well into my 20’s, however I’d never owned a BMX before, so some things took me a little longer to figure out than they perhaps should have. It turns out there’s no way to remove the fork from the headset without first removing the crimp on the front break cable and pulling it through part of the sheath.
With the fork and handle bar removed, I attacked the frame. I planned to remove the headset and head tube, leaving the two intact but was a little worried the heat of the cutoff disk (way faster than a hacksaw) would ignite the paint, so I used a wire brush drill attachment to remove the paint from around the head tube first. Finally it was time to do irreparable damage to the bike, so I grabbed the angle grinder, and the cutoff disk and set to work. About now is when I thought to start taking photos, unfortunately this was after I’d removed the head tube.
That’s the extent of the physical build so far. I’ve decided that building my own motor controller is the way forward from an electronics point of view. While I’ve designed and built 3ph motor controllers before, they were on the order of 100W, 3kW is going to pose some interesting challenges. Why am I building my own controller you ask? I’d originally planned on using a cheap Chinese motor controller from a model aircraft, however these don’t like high torque startups. They’re designed for running props, which provide almost no torque at low speeds and typically have no current limit, so will spontaneously explode if you try doing anything too mean to them. While there are reasonably priced controllers available for vehicle use which over come these limitations, they normally assume a much higher phase inductance and resistance. Also, as reasonably priced as they may be, they still aren’t cheap. Finally, I love a challenge, and enjoy pushing my abilities, so here’s hoping I can manage that without too many lost FETs (especially since some of them approach $20 each and I need a dozen of them!).
First off, I’d like to point out, that I have no idea who you, dear reader, are. You may be a builder, a school teacher, or a particle physicist studying Bose-Einstein Condensate. You may be a maths nerd, or you may be terrified of numbers (if the latter then I’m sorry, there are a few below). I’m trying to make these post both informative and at the same time readable by as large a segment of the population as I can. So if things are too advanced, or too simple, you can try to comment, or else just try and push through. Of course there’s always the option of leaving and never returning, but I really hope you don’t take that option. Right, moving on …
With a form factor and performance criteria decided upon (trike, and 50kmph respectively) it was time to do some math and figure out how to achieve this. I’d already half decided to go with RC aircraft motors due to their abundance and low $/kW. A quick search on my favourite rubbish Chinese hobby site (www.hobbyking.com) turned up [these little gems]. While there exist higher power motors, what I’m looking for here is the low KV rating. KV is a measure of the motors speed for a given voltage. If I’m planning on running a 30V battery pack (a 6S lithium polymer for example) I can expect a top (unloaded) speed of 30 * 270 = 8100rpm. A higher KV will obviously lead to a higher rpm, as will a higher voltage.
The power in a motor is equal to its rotational velocity times its torque. Unfortunately it turns out that speed is way easier to achieve than torque for a given motor diameter. This results in some insane devices such as [this] which manages to produce 12kW (that’s 16hp!) in a package that weighs less than 1kg by turning at 50,000rpm. So what’s wrong with this you say? The problem, is a lack of torque. The rotor may turn at 50,000rpm with no load, but I’m going to have a load. I’m going to need to accelerate the bulk of me + trike, to over come air resistance (drag) and to push my way up some of the many hills around my home town. All these things need torque, not just speed. Now I could always connect the motor to an elaborate gearbox with a 200:1 speed ratio to obtain some serious torque at a reasonable speed, but it turns out that 200:1 gearboxes include some pretty major design and construction challenges I just wasn’t willing to tackle with my limited tool selection, hence the relatively lower power & rpm of the motor chosen.
So we know the maximum power, and the maximum speed of the motor, what about the torque? This is a fun one. I’m going to start by making a statement; Maximum power occurs at 50% of maximum speed. Using this and the knowledge that torque for a BLDC motor (like the one above) is at a maximum at 0rpm and decreased linearly to zero at maximum speed we can work out the maximum torque. I’d love to go into more detail about the math and physics behind this but there’s just not going to be time this post. If people want to know, message me and I’ll put it in another post.
So at maximum power, the rotational speed is 8100rpm/2 = 4050rpm. Power is equal to torque * rotational speed however we need the speed to be in the right unit, and rpm isn’t the right unit, we need rad/s. A rad is a measure of angle, like degrees, except that a circle has 360 degrees, but 2*pi rads. Thankfully it’s easy to convert. 4050rpm /60*2*pi = 424rad/s so at maximum power the torque is 2400W / 424rad/s=5Nm
To power this magnificent contraption I’m currently looking at using two 5800mAh 8S LiPo battery, like [this one] in parallel. These batteries can manage amazing power and energy densities while being reasonably priced and light weight. The only thing to keep in mind is the discharge current limit. The linked battery claims 25C, which means you can discharge at 25x the capacity, or in this case 25 * 5600mA = 145A per battery.
[For the math/physics geeks; try doing dimensional analysis on what a ‘C’ is. 25C * 5.8Ahr = 145A, so C mush have units of per hr, which is just per second with a scalar. Per second is also known as Hz and is a measure of frequency. Go figure, 25C is the same as 90kHz. If anyone can provide an intuitive insight to this I’m keen to hear it].
Back on topic. Since I have two batteries I could theoretically draw up to 290A. However given the slightly dubious source of these batteries I would recommend giving yourself some headroom. In my case the motors are only rated for 90A peak (of equally dubious amps) anyway, so I have plenty of operating margin.
The next decision made was around the drive wheel size. I wanted it to be as small as possible while still being a pneumatic tire. The reasoning behind this comes back to torque. My chosen motor spins fairly quickly. We know that torque, speed and power are all related, but none of these things directly result in forward motion. If we want to move forward, we need a force. The force is applied by the rear tires to the ground, and is directly related to the torque by the simple relation Force = Torque / Distance, where in this case the distance is the radius of the wheel. So, assuming that our motor gives a certain torque, the bigger the wheel, the smaller the force. Of course there is also a reciprocal relationship between Speed, Angular Velocity and Radius, so again assuming the motor is turning at a given angular velocity, reducing the wheel size reduces the speed. With the above in mind, I wanted to minimize the required gearing ratio between the motor and the wheel ergo, the smallest possible wheel.
There are a number of small pneumatic wheels available. From the very cheap hand truck sort, up to the much more expensive go kart wheels. In the end I settled on the back wheel of a pocket bike. If you’ve not come across a pocket bike before they’re small motor bikes, think clown bike small. They also have the huge advantage of being plentiful, reasonably cheap, and somewhat standardised. Browsing my favourite online chinese export company netted me [these beauts]. The major advantage of the pocket bike wheels is that they’re designed to be driven at speed, by a very small (though admittedly gasoline) engine. This means there’s also a selection of sprockets and chains designed to go with them available at low prices. Awesome!
Now that I have a wheel I can figure out how fast I need it to turn in order to get me to 50kmph. Our rim has a diameter of 6.5″ = 165mm. Most pneumatic wheels size the rim, not the entire wheel, the notable exception being bicycles. On this wheel we have a tire, which is 110mm wide, and has a profile that is 50% of the width, that’s what the 110/50 means. So we have a rim to road thickness of 55mm. Double that (the tire is on both sides of the wheel) and add it to the rim for a total diameter of 275mm. The circumference of the tire is the diameter * pi = 864mm/rev or 0.864m/rev or 0.000864km/rev so, for every revolution we will move forward 0.000864km. Next, 50km/hr divide by 0.000864km/rev = 57870 rev/hr. But we don’t want rev/hr we want rpm, or rev/minute so divide by 60 to get 965rpm.
Right, that was a fair bit of math, but it’s important. We now know how fast we need to turn our wheel to travel at 50kmph. Unfortunately here’s where things get tricky. We know the motor will spin at up to 8100 rpm so we could just use that number and calculate a required gear ratio of 1:8.4, however this is just an approximation. In reality the motor’s not going to spin at 8100rpm, there is going to be a load on the motor due to friction, drag, etc. It turns out that these things are pretty small, but I’m an engineer so I wanted to take them into account as much as possible. So not to bore you too much (if you’ve read down to here you’re a masacist anyway though) I’ll race through this next part really fast.
Drag due to air friction is given by Fd = 0.6 * A * Cd * v^2 where 0.8 is 0.5 * the density of air (~1.2kg/m^3), A is the cross sectional area of the object, Cd is the coefficient of drag, and v is the velocity in m/s. Here’s where I made some rough assumptions, A = 0.5m^2, Cd = 1. the coefficient of drag is especially pie in the sky stuff but I’d rather be slightly pessimistic than overly optimistic. Now that I can find my drag force at any velocity, and I can also plot the torque of the motor at any velocity, and I know the relationship between torque and force (remember the wheel radius?), I can plot both those things on the same graph, and where the torque from the motor = the torque from the load I have my maximum speed. At least I nearly can, I forgot about the gear ratio of the sprockets so now my torque is multiplied by the ratio, and speed is divided, but that’s easy enough to factor in.
I can actually work out a fair bit more than that too. I now have the difference in torque available and torque required to overcome drag at all speeds below maximum speed. The remaining torque can be used for acceleration.The simple relationship between force and acceleration is a = F/ m, where m is the mass of the vehicle and rider (we’ll say about 100kg) and F is the available acceleration torque referred back to a force through the gearbox and wheel, and obviously, a is the acceleration we’re trying to find. If we sub in the prvious equations relating back to torque where relevant we get one big equation, a = (Tm * Rg / rw – Fd) / m where, Tm = available motor torque, Fd = drag force, Rg = gear ratio, rw = wheel radius, and m is our 100kg lump. Cool, so now we’ve determined our acceleration at each speed, all we need to do is create a recursive loop which starts a 0kmph, determines our acceleration, calculates our new speed some small time later (lets say for arguments sake 0.1s), use our new speed to determine our acceleration for the next step, and repeat. The more math savvy readers out there will recognize this as an approximation to integration.
Rather than going though all this every time I want to change a parameter, I created a spreadsheet to do it all for me. I’m going to make the spreadsheet available under the proviso that it was built as a tool to be used by me. As a result it’s full of potential gotchas and caveats.
For more years than I can remember I’ve longed for an electric vehicle. As an electronics engineer they hold a certain aesthetic appeal which has drawn me to them. While building an electric motorbike is my long term dream, it is a huge financial investment which I could never attempt in a half-arsed manner. Go big or go home.
Since that’s off the cards for the foreseeable future I set my sights on something smaller. I considered all manner of vehicles; push bikes, scooters, skateboards, etc. In the end I stumbled across two things which lead me to decide on a form factor. This post (http://build-its.blogspot.com/2013/03/electric-tricycle.html) and the obscure, fun, and insane looking sport of drift triking.
A small detour down into the world of drift trikes, almost all of which are custom built, and a little spreadsheet used to calculate gear ratios, power consumption, top speed etc and I arrived at this:
Well that’s the plan so far anyway. Currently missing are the seat, optional extras such as brakes, lights, etc and more importantly I have no idea where or how I’m going to attach batteries and motor controllers. Just in case you missed it, the two orange things, are ~2kW electric brushless RC motors. They will be coupled to the wheels by a #25 chain and sprocket (8 teeth to 64 teeth). Running off a 10Ahr 30V battery I should be able to get to ~50kmph and get to 30kmph within 2 seconds. Of course there’s plenty of power there so a trade off has to be reached between acceleration and top speed, I’m leaning towards acceleration under the presumption that any more than 50k on this thing is going to be … unpleasant.
A number of details are still bugging me (the above mentioned aside) such as the exact headset angle and top tube length. As drawn I worry it may be bit of a stretch to the handle bars, but that will be hard to know until I have the bits available to set out and do a test fit.
Now that I’ve given an overview of what I’m hoping to achieve I think it’s time to call it a night. At some stage I plan on making a post where I discuss the nitty gritty of my decisions and the trade offs I’ve made. That post will be dedicated to the people like me who don’t shy away from a little basic math & physics.
For quite some time now I’ve been an avid creator and dreamer. Ever since I was old enough to pick up a screw driver I’ve been building things. At first these were kit sets from the local electronics shop. Later, after I obtained my degree in Electrical Engineering and more importantly, the necessary skills, I began to create my own… Devices? Creations? Whatever you want to call them.
While working on these projects of mine I often browsed the works of others, some particuarly noteworthy such as Charles Guan (http://www.etotheipiplusone.net/) and Quinn Dunki (http://quinndunki.com/blondihacks/), and many others who’d done amazing work and taken the time to share their experiences with the public at large.
Shortly after beginning the planning stages of one of my projects I was convinced by a friend (Nighthawk, http://www.southernrider.co.nz/projects/) that I should blog my progress as a means of both documenting my progress and maintaining motivation. This, coupled with the desire to share my failings with the world so that others may learn from them, lead to the creation of this blog.
I make no promises, in two years time this could be a treasure trove of information or another dead site littering the internet. Here’s hoping for the former.
Just making my way though the start up procedure for wordpress. We’ll see what happens.