Electric Mini Bike Build (In Progress)

Hello everyone! :smiley:

This is my first post here on the Level 1 forums, so I hope you all enjoy it!

I’m currently a student in my third year of Electronics Engineering Technology. As such, I have to design and build some sort of project which will count as one of my class credits. Since I bought an old used Baja Bike during the summer, I thought I would do something fun and change it to a fully electric drive-train. I’ve been working on it since mid-September. Here’s my progress thus far.

Removing the engine

Here we have what I started with. It’s a 4-stroke 97cc Baja Bike, making roughly 2.8HP. It’s got a centrifugal clutch, and has a top speed of about 49kph (30mph). It’s a pretty fun little bike. Here I’ll be removing the engine and all the other components.

There’s the old throttle (just a cable to the carburator) as well as the engine kill switch.

Now that that’s gone, to the engine!

All the fluids and such were drained before I brought it out to school with me.

There’s the centrifugal clutch, with the exhaust sitting just above it. Removing this was surprisingly simple, just 2 bolts were holding it in place on the bottom!

Taadaa! She’s out! And incredibly filthy. Afterwards I had to scrape off all the crap from the frame, and my kitchen floor lol, but eventually I got it relatively clean.

Battery Modifications

So my lithium-ion battery came in finally! It’s a 48V/20Amp-hour battery. Unfortunately, the battery cables are too small to handle the current I’ll need (10AWG, which can only handle 30A, and I need ~50A), so I’ll need to swap them out. I already ordered some 6AWG for the rest of the bike’s wiring, so I can just use that.

On top we have the battery management system, sitting on top of all the battery cells.

Here we can see all the positive ends of the battery cells. I also made a really stupid mistake, and let the negative lead just hang off the side, causing a huge ass arc which melted a section of one of the spot welds. Thankfully the battery’s still fine, but man did that scare the shit out of my girlfriend and I lol.

Here’s the exposed BMS circuit board, where I’ll have to take out the old negative leads and solder in new ones. The positive lead was rather easy, but this is quite a bit more cramped.

Eventually I finally got them. I’m aware they’re not the cleanest solders, but it was an insanely tight fit, had to file out some of the board to get them to fit, but they’re firmly attached and should be fine.

Here’s the final battery. I wrapped it in electrical tape just to protect it a bit. The third smaller cable you see is the charge port for the AC adapter.

Configuration

Here, I need to hook up my controller to the battery in order to configure it, and figure out how the hell the motor hall sensors are attached. Here’s the connector for the controller’s low voltage wiring, which I soldered and wrapped up.

Here’s the entire setup. I have the battery connected to the controller’s 48V power on pin, and ground. Then, the controller’s hall sensors are connected to the motor’s via my breadboard (which is also supplying 5V to the motor’s hall sensors), and finally the controller is hooked up to my computer through a USB to serial connector.

This is what the configuration tool looks like (excuse the bad quality, I didn’t have a screenshot, and don’t have access to my controller at the moment). Pretty simple, just put whatever settings I want to use and it works.

Hardware Mounting

Here comes the fun part. Now I need to start mounting hardware to get my prototype done on time.
Here I just screwed on the twist throttle for the motor (1-4V Hall throttle), as well as a 0-5V thumb throttle for the regenerative braking, which I plan on implementing to maximize range.


Here I start the mounting of the main components. For both the battery and the controller, I managed to get some project boxes from my professor which I’ll be using (they’re normally used for an audio amp project I put together last year). This particular one is the battery, since I wanted the heaviest components as low and as centrally mounted as possible.

Here I’m making mounting brackets for the top of the project box from some L-brackets.

Welp, looks like I overestimated how tall the frame was, so instead of cutting more L-brackets and mounting them vertically, I have to drill new holes in between them. Thankfully it’s quite sturdy, and should be more than strong enough to hold it in place.

Mounting the second project box for the controller. I somehow really lucked out, and the controller mounting holes are the same width as my frame!

It’s all mounted and set. Wait… How am I gonna get the seat back on? O_O

Well that was a struggle lol, I spent like 20 minutes trying to squeeze the seat back on, before finally caving and just dropping the box a bit so I could squeeze my hand in to mount it.

We have a motor! the motor fit perfectly, and I was even able to reuse two old mounting holes!

I also put the battery in the box, drilled holes for all the wiring, and put the back of it back on.

Here I mounted the 50A/48Vdc circuit breaker on the outside to make some more room for the other components, and it’s waterproof! Thank you random marine equipment supplier on amazon!

Finally, we have the contactor, which will be switching on and off my main battery to controller cable.

Wiring

Now that all the main hardware is mounted, I need to get to work on the wiring. First, I’m doing all the 6 gauge wiring. I’m starting with the smaller bits since I didn’t have much time on this day.

Here I drilled a hole for the battery negative wire, and connected the positive to the breaker.

Then, I connected the negative to the controller, and another short wire going from the breaker to the contactor. Now all the large wiring is done, and it’ll get a little more complicated.

Before I started, I finished the connector by adding the metal screw-on piece to protect the surprisingly fragile connectors, and I labelled all the wires to save myself some headaches later on.

Then, I soldered on some solid wires to the throttle wires so I could plug them into my smaller breadboard and hopefully get it working soon.

UGH NOOOO!! :expressionless: I wired everything, and most of it seems to work. The contactor switches on, and the controller turns on and shows no error codes. But the throttle doesn’t do anything. I was busy troubleshooting this for a couple hours, discovering that no current was even leaving the battery when the throttle was turned. Odd… I asked my professor for some help trying to figure this one out. We analyzed my schematics and wiring for about 40 minutes, before we discovered that the regenerative braking switch (unlike the throttle, which is necessary for it to function), is actually another type of regen input, and since I had it connected straight to ground, it was just completely blocking all current. Once we got that fixed, the motor finally made noise! But it still wasn’t moving, just making a quiet clicking noise, but I knew what to do to fix it.

Since it’s a brushless DC motor with hall sensors, there’s only 2 way of wiring it correctly, forwards and backwards. If the 3 phase wires are in any other configuration, they either will not move, only making a clicking noise, or they will run incredibly rough, turning much less smoothly than it should and hesitating at low throttle inputs. Eventually I found the right configuration, and ditched my alligator clips and soldered on the wires for the keyswitch and the coil to switch everything on.
9

Here’s where I’m at right now. All I need to do is drill a hole for the keyswitch, size and mount the chain, mount the breadboard, and finally put the project box cover back on and my prototype will be done!
10

After the prototype stage, I need to add some final touches in order for it to be finalized by March.

Since my keyswitch has an extra wire in parallel in the second position, I plan on adding a DC-DC converter to power some 12V LED lights, turn signals (for which I already designed a PCB and programmed for an arduino Nano), some rubber grommets so I don’t have to keep using electrical tape to save my wires, and of course paint it. I’m thinking a nice dark purple for the frame with black on the project boxes.

Hope you all enjoyed my build thus far, and I’ll be posting updates for it once I get back to school next week! :smile:

8 Likes

Super cool project, looks fun.

I suggest these to seal up your knock outs

https://www.amazon.com/dp/B01N4EWAP1/ref=cm_sw_r_cp_apa_svhrAbQPPR5K6

3 Likes

A+ thread 10/10 would have deep concern again

4 Likes

Glad you like it!

And thanks, that’s actually perfect for what I need.

1 Like

Haha, thanks man :joy:

I figured I’d include that so no one else makes the same dumb mistake I did and nearly causes a fire lol

1 Like

Yeah I can never remember the name for those things

1 Like

My friend tesla500 built a bike just like that from a “Kid’s Harley frame.” Had some hefty tires.

If you’re an electrical engineering student, him and EEVblog are definitely worth checking out.

1 Like

I just watched the video you suggested, that’s a pretty awesome bike!

And I actually just discovered EEVblog a few hours ago, I’ve been watching a bunch of his videos.

I helped with the videos for tesla500’s Kickstarter for the high speed camera “Chronos 1.4” which he built from scratch. He also tried to make an “electric car” a few years ago too.

1 Like

Awesome project. Love it.

1 Like

Thanks, glad you like it! It’s certainly been a fun project to work on.

Quick update on the bike project.

Since I’m back to school as of this past Wednesday, I started putting the final touches on my prototype in order to get it ready for this Friday. I drilled a hole for the key switch, mounted the breadboard, and put the cover back on the project box.

Here’s a closer look. Don’t mind the electrical tape, it’s only temporary.

I then started putting the chain back on so I can actually ride it. It took quite some time, my hands were covered in tons of black grease from the chain, and after struggling to shorten the chain and resize it, I finally got it back on. I turned the throttle, and it starts moving! I give it a bit more throttle, and then I hear a horrible clunking sound coming from the chain. I check to see what the hell is going on, and it turns out the chain is skipping! What? How the hell is this possible? So, I take the chain back off, and wrap it around the motor sprocket. Sure enough, the motor sprocket’s teeth are closer together than my chain links, and I’m shit out of luck. :grinning::gun:

So, I’ve got quite the dilemma here, how the hell am I gonna get a new sprocket for an electric motor that fits a #35 chain within a week… I honestly didn’t know what to do, so I asked around my class, and sure enough one of my classmates mentioned that I could weld the old gas sprocket and the electric one together. I’d just need to grind it down, and then weld it on.

The only problem is that I don’t have access to a welder. Thankfully, that same classmate said that if I can grind it down for him and cut out the gas sprocket, he’d weld it for me. Then, a friend of mine mentioned that he actually has a grinder wheel in his garage we could use. Yessss! I might be okay after all!

So, we went over, dug the grinder out of his garage in -30 degree weather, and proceeded to grind down the electric sprocket to a relatively smooth circle. We also cut out the gas sprocket since it was part of an end that inserted into the old clutch. It was my first time grinding something, so that was an interesting experience.

Then, earlier today I gave it to my classmate, and he welded it together just a few hours ago!

26696426_1426119397500237_285297056_n

So that’s it for now. I’m gonna be working on it again tomorrow afternoon, so hopefully I can finally get it done so I can ride it, present it, and do snow burnouts!

4 Likes

I tried to like your post but each time it says “Sorry, and error has occurred.” Consider this your like instead…
Oops, my network connection had timed out.

1 Like

No worries man, I appreciate it!

I was finally able to mount the sprocket back onto the motor, which was a perfect fit! I then re-tightened the chain back on, slid the little chain tensioner pulley back in, and it seemed to fit right. I got on, hit the brake and slowly crept the motor up. Thankfully it didn’t move, which is an improvement from last time. However, things weren’t all fine and dandy unfortunately. As I sat on and sped my way down the hall, the chain seemed to slip a few times, making more of those awful clunking noises. :neutral_face::gun:

It seems that the chain, while better mated to the sprocket, isn’t wrapping all the way around cleanly, even though it is the right size. While spinning the wheel, the chain also occasionally slacks a bit since it can’t wrap itself cleanly around. So, I suspect I need a sprung chain tensioner, and my chain might be a bit stretched out. The bike is a couple years old, so it would make sense. I already have the parts to make a sprung tensioner, so I’ll be doing that tomorrow after class. I just hope this works… :flushed:

( former bike mechanic for a large rental fleet)if the chain is old as dirt toss it and get a new one. you will fight and fight and fight and never get it right. second check the sprocket for flatness if it is warped you will also face issues with the chain popping/ derailing. can possibly fix it with a big enough hammer and a blowtorch. also if the teeth on the sprocket are not wide enough for the chain to seat it self flat using a round file to widen the valley is also a path to look into. and last but not least ensure that the alignment from motor to rear sprocket are as straight as possible. a deviation of a few MM can play hell with the chain as well.

1 Like

Thanks for the reply! The chain is fairly old, but it’s not the most pressing problem right now. I checked the sprocket, and it’s what’s causing most if not all of my problems right now. Its just warped enough that the very last connecting link doesn’t quite fit since the tooth spacing is slightly too big. I’ll try to figure something out tomorrow so I can minimize the slipping a bit. As for the alignment, it’s dead straight, so I think I’m good on that front.

Here is the finished prototype as it currently sits.

Now that the first semester is finally finished, I have a bunch of plans I want to add to improve upon it during the second semester. I’ll of course be solving the most prominent mechanical issue as I have a new motor sprocket on the way and a new chain for it as well. I’ll also be adding a whole bunch of lights to it so it can be driven at night. I’ll be controlling brake lights and turn signals with the help of an Arduino. I’ll also be making a PCB to replace my breadboard and for all the lighting controls.

I’ll be tuning my motor controller for a bit more power. As it sits, it’s around 54.6V and pulling about 35 amps (1910 W). Since my motor controller does some current multiplication, I’ll be setting it to probably around 45A battery current, and probably around 55A motor current to have 3000 W. I may also get a smaller sprocket for my rear tire, although I’ll have to do some top speed testing before I do that.

1 Like

overall for a rough and ready prototype its good. i have a few niggles with the chain length and the tension mechanism but overall use what you have and you did a great job.

https://www.amazon.com/chain-tool/s?ie=UTF8&page=1&rh=i%3Aaps%2Ck%3Achain%20tool
your best friend for when you get the new chain. the most slack you want in the chain is about 2-3 MM the least is 1MM of travel when pressing the top of the chain.

blinkers and lights can be controlled with dip switches a lot easier than with an Arduino but if you want to make it all talk back and forth go for it. ( im a fan of simple toggle on toggle off.) the hardest part would be the pressure switch for brake light.

now if you wanted to get fancy with your speed selection you can employ a system similar to a 3 speed rim . in fact its what i recommend for managing slow start with a high top speed. ( note requires a lot of modding to current rim or stand in rim and access to a machine shop) example of what product i am talking about below . if you can do it i would as it fills the need to change rear sprocket and allows 2 more gears.


i built a bike rim around the hub listed and i loved it made my job as a bike riding traveling mechanic a lot better. no you cant plop it in and have it work but if you have the guts to mod and fail then go for it.

looking forward to what your final creation looks like.

1 Like

Thanks, I appreciate it! I know the chain mechanism isn’t exactly ideal, I’ll be doing lots of tweaking and small fixes to it in the near future. The tensioner itself is actually a piece of steel L-bracket cut in half lengthwise, the original fixed chain tensioner, and the spring from my kickstand. I also actually just bought a chain removal tool as well funny enough. And alright, I’ll keep those measurements in mind.

As for the lights, the headlights and taillights would be connected directly to the PCB and the entire 12V system through the 3rd position of the key switch (1st - Off, 2nd - Motor On, 3rd - Motor + 12V On).

For the turn signals, I may actually just use those switches for simplicity’s sake. But yeah, as you said the brake light would be a bit trickier, I may keep the Arduino just for that, and just have a toggle that switches a transistor like I was originally thinking for my turn signals. I just ordered a new brake handle with an electronic toggle built in, but I don’t yet know if the switch could even handle the load, so I’ll see once I get it.

For the speed, I do find the idea of having extra gears kinda nice, although I think I’ll stick with just a simple direct drive setup. I don’t need it to go all that fast, since it’ll be mostly for trails and stuff of that nature, with some light road use in between.