Showing posts with label Presently UnNamed Tricycle. Show all posts
Showing posts with label Presently UnNamed Tricycle. Show all posts

October 6, 2023

Trike Revival for the BD Car Show

Robot land has an annual car-and-other-vehicles show.  Last year I brought the hybrid car powertrain go kart, but this year the kart's geting some upgrades (stay tuned), so I brought the electric tricycle instead.

The trike has been hanging from a miters wall unused since  2019.  The last time it was ridden, someone crashed it into a curb and bent the head tube inwards, so it needed some work to get back into a rideable state.

Somehow it's been ~11 years since I built the tricycle - looking back at the blog to jog my memory, this was one of my first big projects at miters, one of my first projects using a mill and lathe, and the first thing I ever designed in Solidworks.  It's a miracle it worked.

Here's the trike pulled down from the wall.  The battery cover broke ages ago so the battery is strapped in with tape.  Most of the wires are held together by duct tape.  The brake and shifter cable housings are frayed, and 5th gear sounds super crunchy.  And that head tube angle...


First order of business was to take it apart and do a little inspection and de-grunging.  I'd forgotten how much mileage the trike got - there was  period of time in undergrad where it got ridden once or twice a week, and it shows in the amount of chail lube and dirt caked onto everything:


The shifting wasn't working well, so I pulled the chains and Shimano gearbox:


The spur gear differential was one of the more complicated things I'd machined at the time, and it was... a learning experience.  At the time I didn't know that I should never trust communal mills to be trammed (or how to tram a mill, for that matter), so the bores for the six shafts that span across the differential aren't very perpendicular to the end plates.  As a results, the differential was super finicky to assemble and would bind up if the fasteners were tightened in the wrong order.  Also apparently I hand't learned about chamfers either - those corners sure are sharp.


The turnigy 80-100 motor Shane donate to the cause was still working fine, but the position sensing and motor control setup was never great - I used a Kelly KBS brushless controller plus one of Charles's external hall effect sensor boards that measures flux leaking through the OD  of the rotor.  The Kelly controllers aren't great at driving low inductance hobby motors, and would periodically fault when pushing the trike hard.  The external hall sensors weren't great either, between the wires falling off, the hall sensors mysteriously dying, the sensors rubbing the outside of the motor, and the timing vibrating out of alignment:


The original seat was a fiberglass monstrosity made of an old bicycle saddle, and years of newbie riders doing wheelies by accident had scraped the back edge off.


I found a perfect replacement for the seat in a bin at miters: an old Brooks B-67(?) double-rail saddle:


The trike wasnt bult with swapping seats in mind - I welded the rails of the original bicycle seat straight to the frame.  This Brooks saddle uses a funny double-rail mounting system where the clamp is built into the saddle, rather than into the seatpost like normal.  Instead of welding more stuff to the frame, I turned a little seat post stub and bolted it on:



The curb incident bent the curved frame tube rather than breaking the weld with the head tube - I found this tube pre-curved on the miters floor, so it's made of some mystery-alloy low strength steel.  I put a steel bar in the vice and did some gentle persuasion to get the steering back in alignment.  I think the trike would handle better with a slacker head tube angle , but to change the angle that much I should really chop and re-weld the head tube.


I brought the pile of parts home from miters and did the rest of the repairs in the home shop.  I got this cheap e-bike controller shaped VESC as a replacement for the Kelly - it's not higher power, but supposedly supported external SPI encoders, and a real encoder + FOC should be big improvement over the old hall sensor and trapezoidal drive setuop.  It claims to be a 120A max controller, but I've only gone up to 75A so far - internally it's just got 6 TO-220 package FETs, so I'm probably not going to push it much further:


Turns out the controller didn't really support external SPI encoders.  I wired up the encoder to the hall sensor cable according to a guide I found online, but it didn't work.  Probing around with a scope, the signals looked nothing at all like SPI. 

I cracked the controller open and immediately found the problem - there were RC filters and pull-ups/downs on the pins, for hall effect sensors.  More probing around and I was able to figure out what modifications to make - the picture below shows the full set of changes I made to the drive.  Initially I had solder bridges instead of the 100 ohm resistors, but I found that the SPI only worked when I was scoping the clock pin - I gues the tiny bit of capacitance from the scope probe was damping out some ringing edges.  The 100 ohm resistors in series fixed everything.


I machined a holder for a diametric encoder magnet:


And 3d-printed a holder for an encoder breakout board:


The original plastic battery cover got destroyed ages ago, so I did some CAD - the other CAD - and whipped up a new one out of some thin aluminum sheet.


Yes, that's a frozen pizza box, thanks Jared.


I don't have any sort of bending brake, so the sheet was bent with a combinations of quick-grip clamps and aluminum billets.



I made a cover for the other side of the battery (which it never had before):


I replaced the brake and shifter cables as well - the originals never had ferrules on either the cable housing ends or cable ends, so they were fraying and in terrible shape.  I did a test ride the evening before the show with a 50A current limit and didn't run into any issues.  I turnued it up to 75A the morning before the show and didn't test, fortunately it didn't blow up despite some coworkers' thrashing it.


I didn't take many pictures or videos at the show itself, but parking it next to a Ferrari wagon (I can't beleive that's even a thing) was entertaining.  Lots of test rides with no issues other than a set screw coming loose once.  It could definitely use a bit more motor controller - it's noticeably less peppy than before (with a 120A limit on the Kelly controller).  

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.

May 15, 2013

Electric Tricycle, now with Gaudy Lighting

 Using a couple feet of RGB LED strips I found in a drawer at MITERS, I made some obnoxiously colorful and bright lights for the tricycle.


This little circuit has some NPN transistors and a 7805 voltage regulator on it.


The voltage regulator powers an Arduino pro mini that sits on top of the board.  This reads the throttle signal, and converts the throttle position into a color for the LEDs.  The LEDs are mapped to the throttle such that the color of the strip shifts through the rainbow as you change the throttle position.  To smoothly transition between colors, the Arduino handles an HSV to RGB conversion.  The throttle position is just proportional to hue value.  The conversion was done with a modified version of this code.  


I crammed the Arduino, transistor board, and tiny DC-DC converter into the cut-down plastic casing from a wall wart, and used an audio jack for quick-disconnecting the the power, ground, and signal lines.


The assembly attaches to the motor controller with a little bent-polycarbonate clip:


 A video of the lights in action:

April 14, 2013

Bike, Trike, and Science


I was not able to scavenge a stem, so I welded up my own out of... steel.  When the new TIG welder arrives at MITERS, and I learn how to use it properly, I'll weld up an aluminum one.  I did not have a proper set of bearings for the top of the headset, so I made an experimental headset bushing out of Delrin.



I also made a simple seatpost clamp out of aluminum:


And here is the bike, in its current state:


The only remaining features I need to add to the frame are cable stops for the back brake.


From some thorough testing of the electric tricycle, I found a pretty major design flaw.  When turning sharply at speed, it was possible to over-lean, causing the foot pegs on the front wheel to scrape the ground.  This would torque the front wheel sideways, sending the rider over the handlebars.  I honestly just did not expect to ever lean so far in turns, so I built in no sort of lean-limiting features.

The easiest and least intrusive way to limit leaning was to add stops just under the seat.   I bent some thick steel rod, and welded it under the seat frame.  I added nylon caps to the ends, so the steel will not gouge into the aluminum.




From some testing in a wet parking garage, the stops seem to be strong enough.  When cornering, the water caused the back wheels to slide out.  Normally, this would have sent the foot pegs into the concrete.  Once I get used to the stops, the should let me slide around corners without having to put my feet down.

Also, CPW happened.  A host of prefrosh swarmed MITERS, and built things like ducted fan powered RC vehicles, Jacob's ladders, and more.  A significant portion of them rode the trike up and down the halls of N52.  I'm happy to say that it was a big hit, and neither it nor any prefrosh sustained any damage.

Back on Putz, we did some science.  It started with left over liquid nitrogen from CryoFAC , and devolved into burning things with a 12 kV neon sign transformer.  We found that some interesting things happen when you put twelve thousand volts through damp wood.  The electricity slowly burns through the least resistance path in the wood, creating a sort of high-carbon wire that glows bright orange.  This effect could be controlled by laying down graphite on the surface of the wood with a pencil.  The graphite trace directs the current, which then burns the wood along the trace.  Here's what "EC"  burned into the wood looks like:



March 4, 2013

Tricycle Shenanigans, Pre-CPW Stress Testing

The tricycle has actually been done for a few weeks now.  The two things stopping me from doing a final writeup are that I have still not gotten around to taking nice pictures of it, and until yesterday, I did have any good videos either.  In the acquisition of the video, some parts of the trike were broken, so now the pictures have to wait until everything is fixed and pretty again.  Here is as close to a final picture as I have right now:


Before doing any thorough testing, I remade the stem, which I broke just before TechFair.  The original stem was made from a block of aluminum that was a little bit too small.  I had to use thinner bolts than I would have liked to, and they were the super-shady kind of bolt MITERS probably purchased by clicking "sort by lowest price."  The fit around the handlebars was never ideal, so I had to crank the bolts especially tight to stop the bars from rotating.  I overtightened one of the shady bolts, and sheared it off inside the stem.  I may have been able to remove the left over bolt-stump, but the failure was a good excuse to make a new and better stem.

Here's the back end of the old stem, with embedded bolt:


I made the new one much better looking.  I started out by facing all six sides of a large chunk of aluminum, which used to be part of an even larger billet that found its way to MITERS from the CSAIL stock room.


To make the circular lip that holds down the headset bearings, I clamped the block to an indexing table:


Also using the indexing table, I milled a nice curved face into the front of the stem, à la Amy:


I drilled and countersunk all the holes on the mill, and cut the slots on the bandsaw.  All the corners were rounded on a belt sander, and then finished with some sandpaper by hand.  Also, this time around the headeset cap sits flush with the surface of the stem rather than sticking above everything.


And finally, here is some real footage of the trike in action!


Jaguar and I started out by taking it to the Kresge oval, but the path turned out to be too rough in places to sustain very high speeds.  On the way there from EC, we attempted some 2 person riding, to determine whether it would be possible to trike around with  prefrosh on the back during CPW.  This kind of worked.  The second person rides by standing on the back platform and leaning forward, holding onto the driver's shoulders.  This riding method caused two problems - one per foot.  If the rider's feet are hanging off the back of the platform, and they lean back, their heels put pressure on the things sticking out behind the metal:  The battery cover on the left, and the power switch on the right.  The acrylic battery case snapped into 3 pieces, and the power switch also broke.  I was able to duct-tape the switch together enough to keep it working, but it will need to be replaced.  I will probably remake the battery cover out of carbon fiber, since carbon fiber seems to be my answer to everything right now.  On the way back to EC via the Infinite Basement Corridor, we realized it was two thirty in the morning and no one would know/care if we rode around in the basement tunnels.  Due to their width and slippery floors, the tunnels around Stata are especially good for drifting.  This lead us to what may be the best (well, very early on Sunday mornings, at least) small electric vehicle racing grounds on campus:  the parking lot under the Stata Center.  The concrete surface makes for excellent traction.  It has regular pillars which would make setting up a race course easy, but it also has long straights all the way across its length and width.  There isn't enough space to max out the trike, but we easily got it into the upper 20's (estimate based on which gears we were in) on the straights.

Here it is in its ugly but still functioning state, pre Stata:


The night morning of riding ended when I accidentally pulled loose one of the leads to the hall effect sensor board loose while fiddling with the power switch.  

Some thoughts and observations:

-Some serious prefrosh-proofing would be required to make this a CPW event (e.g. no more acrylic or switches sticking out)
-Swappable battery packs are awesome.
-Even with the current limiting set to around 80% of maximum on the motor side, the controller still sometimes cuts out, especially if you gun the throttle right after shifting.  According to Shane, getting a Kelly with the high speed option would probably eliminate this problem.  To be fair, this is an awfully big motor to be driving with this controller
-MITERS Small EV Rallies in the Stata Garage need to become a thing.  All the pillars and other obstacles would make it pretty easy to set up a temporary racetrack.

January 24, 2013

Battery Building, Motor Woes, and a Rideable Tricycle

Here is an unfortunately large update, due to my blogging laziness.  

I spent way too much time inhaling soldering fumes while building two battery packs for the trike.  As you may notice the cells I ended up using were the green flavored variety (given to me by Dane), rather than the cardboard covered ones  I was planning on using.  The green cells are 2.5 Ah, as opposed to the 2.2 of the others, and have 2/3 the internal resistance.  

I started the packs by making Tetris-like blocks tacked together with hot glue, with cells soldered in parallel.


These blocks were then tacked to each other, and wired in series.  Below is the lower half of one of the packs.  The gap separating the three leftmost cells from the rest of the pack is for the drive shaft.


Each 12S3P pack is actually made from 2 6S3P packs connected in series.  I did this because no hobby chargers (that I know of) can balance charge a 12S pack, and the charger I have been using can only charge up to 6S packs.  Each half of the pack was packaged in "bottle armor" made from giant 3 liter soda bottles.  When heated, soda bottles shrink like heatshrink tubing, and form a hard plastic case when they cool.  The weird 3-cell extension off the pack could not be bottle-covered, so I used a combination of large heatshrink tubing and kapton tape.


For the power leads, I used XT60 connectors - one entire connector each for positive and negative.


To hide the pack, I made a cover out of matte black acrylic.  In the process, I found a really good way of making clean bends in acrylic.  I clamped thick aluminum blocks .25" above and below the bend line, and heated the gap with a heat gun.  The blocks both stop the acrylic outside of the bend area from heating up and prevent anything but the bend line from deforming.


The result:


To stop the battery from banging around, I coated the inside of the battery compartment with soft foam tape.


To make the seat actually able to support a person's weight, I coated over the plastic frame with fiberglass.  First, I covered the frame in electrical tape.  This made a surface for the cloth to rest on, and epoxy does not stick to electrical tape.


Due to the particular epoxies and curing methods I used, the fiberglass turned an unpleasant orange-brown color.  I started out using West Systems 105/205 epoxy, which is what I used on my bamboo bike.  Some rust must have gotten into the hardener container, so the epoxy was bright red.  To cure the epoxy faster, I decided to put it into the reflow oven at MITERS, and bake it at 200 F.  Long story short, don't oven cure with 205 (fast) hardener!  It foamed up and ruined the nice smooth surface.  I continued with a much slower epoxy, which gave much better toaster-oven curing results.


I glued the fiberglass layer to the plastic frame with thickened epoxy.  At the same time, I glued the mounting bolts in place.


After lots of sanding and gap filling with even more epoxy, the seat had a fairly smooth surface, which I spray painted black (I don't have any pictures of that yet).



To attach the external hall effect sensors that let the motor controller determine the position of the rotor, I used a Hall Effect Sensor Board and Sensor Adapter.




The motor controller, fuse and kill switch were all fastened above the motor, to the underside of the top plate:


With everything wired up, I began the process of finding the correct motor phase combinations, and aligning the hall sensors for minimum current draw, using this guide.  This process started out remarkably smoothly.  The motor spun the correct direction on the first try.  I hooked up the controller to a bench power supply with a current readout, and moved the sensor board to the lowest current position.  Things started getting weird when I reverted to battery power.  For no apparent reason, the motor spun the opposite direction when I powered it on.  I had written down the motor phase combination I used, so I know I didn't reassemble it incorrectly.  I cycled phases until is spun the correct way again, and minimized current for a second time.

After this, the trike was actually rideable, and I brought it up to the IDC test track.  Everything was working great until an overzealous sliding turn caused my knee to plant itself in the temporary throttle I found in a box of potentiometers.  The potentiometer unfortunately did not survive.

I made my own thumb trottle out of a chunk of aluminum and an old game pad joystick, but could not get the trike to run smoothly with it.  I thought it had to do with the throttle being too sensitive and causing the controller's over current protection to be tripped.  After reprogramming the controller's throttle response and current limit to no avail, I replaced my throttle with a half twist hall effect throttle from an electric scooter, but the problem persisted.  Sometimes the motor would run smoothly, but most of the time it drew way too much current, would not reach full speed, and produced so little torque it could be stalled by hand.

Not sure what to do, I enlisted the help of Shane to diagnose the problem.  After spending hours adjusting phase combinations, sensor timing, testing the hall sensor outputs, trying another throttle, replacing the throttle cable, redoing the hall sensor wiring, trying a completely new controller, scoping the motor phases while running, and probably some other things I've forgotten, we were able to get it working smoothly again by swapping two of the hall sensor leads and going through the sensor timing process again.

However, when I went back and installed a the kill switch, the motor had reverted to its high-current, low-torque, generally-bad state.  After even more phase and hall swapping, suspicion towards the motor itself was raised - and confirmed.  The short between the windings and the case that I fixed ages ago had reappeared.  It seems that the motor had been intermittently shorting, causing all the motor problems I had.  Fortunately, Shane happened to have a brand new identical motor which he gave me.  At some point I will try to revive the old motor again.


To prepare the motor, I chopped off the threaded side of the shaft, and milled a flat and a dimple into the drive side of the shaft, for the drive sprocket's set screws to grip into.  It has worked beautifully since then, and seems to perform better than the old motor ever did, with both somewhat higher torque and lower no-load current.


Here are some test videos.  I haven't yet done really thorough testing, but when it warms up a bit, I'll put up some outdoor test videos.





It should get some action this weekend, during Bad Ideas, as Bad Ideas decided to fund this project.