Joe's E-bike build


10 mW
Sep 17, 2023
Hello, fellow ebike enthusiasts. I'm starting this thread to document my ebike build that I will be working on (slowly) over the coming months. My basic plan is to build a steel frame with a swingarm and use MTB forks for the front. It will be mid drive with a moped hub for the rear so that I can use two separate chains. One for the motor and one for the pedals. 16" rim on the rear and 18" rim on the front(so 20" and 22" in bicycle terms) I will utilize the hub brake on the rear and a disc(possible double disc) up front. I'm considering the qs165 or qs138. So the battery will be 20s. I'm thinking 8 parallel packs of 20 molicel 28b. I'm still debating on much of the details which is part of the reason I'm posting here.

So far, I have obtained two pit bike frames which I intend to base my frame off of. My plan is to cut these apart and combine them to extend the frame. I purchased a titanium 170 from harbor freight and from my first impressions this is a good machine. My previous machine was an older Chicago electric flux core only model. I've been welding on that old machine for close to 10 years and although it is a crappy welder, you can make it work with good prep and lots of practice! Trust me when I say that using a machine like that will make a better welder out of you(but not without much frustration!).
As you can see these frames are pretty small. For what I'm trying to build I will need to extend them. I will use that extra pipe sitting there as an internal sleeve to take some of the strain off the welds. Obviously having a weld joint right in the middle of the frame is not ideal. I chose these frames because they are close to the design I have in mind and I picked them up for a fair price. My Intention is to cut a cheap bicycle frame up and weld the pieces onto the pit bike frames to add pedals. I want this thing to look quasi legal. I need to find a cheap mild steel bike frame to use for this part. Shouldn't be too hard as there are always plenty of huffys and the like for sale(or free) in my area.

For wheels I'd like to use bicycle rims with moped tires. I want the extra rubber from the moped tires for shock absorbtion, durability and traction. I'm not concerned too much about the extra weight. The bike rims should hold up I think. Bicycle rims should be lighter and help offset the extra weight from using heavy bulky tires vs. Using moped or motorcycle rims. What do you guys think about this? Has anyone ever tried to lace a moped hub to a 20" bike rim? What spokes should I use? Would it be better to drill out the bicycle rim to accept the thick moped spokes or should I just use a moped rim too? I'd like some input here. On the front I'll probably use a 22" bmx rim with a thru axle hub for dual discs. Any suggestions for front forks? Are any of the commonly used forks steel so that I could weld on tabs to mount whatever calipers I choose? I don't have much experience in MTB forks so please help me out here.

I plan to water cool the motor and electronics and possibly my battery pack. I have obtained this small water pump, buck converter and a PC water cooling heat exchanger.
The buck converter is supposed to be good for 96v and 10amps which should be more than enough for the pump. The heat exchanger may end up being too small but I'll start from here. It was less than $20 and should fit nicely on the bottom of the battery in the traditional motorcycle radiator location. To cool the motor I'm planning to wrap it in copper tubing and either put a steel band around the coils with insulation or possibly epoxy over them to keep them from vibrating. I will figure this part out in more detail once I have my selected motor in my hands and can fully consider my options for thermal bonding. I know that there are water cooled motor variations for what I'm looking for but I'm trying to keep costs down where possible. I always like DIY type stuff too, so adding water cooling to an air cooled motor seems like a fun project in and of itself! I'll buy some PC water blocks to cool the mosfets on the controller and buck converter. If I already have a water cooling system in place then why not right? Running copper tubing between the individual 20s packs in my battery should help keep the battery temps in check too I would think. I'm concerned about cold temps as I will be running this all year round to get to work. I may add a heating element to help get the batteries up to temp in certain situations. I could put a heater in the coolant reservoir and run it with a small supplemental battery pack. One that isn't so susceptible to cold temps.

Now for the controller, I'm looking at the Votol controllers because I like the build quality of the boards from what I've seen around the net. The designs seem more straightforward and less compromised for cost cutting measures than some of the other lower-cost controllers. Now I'm probably going to get an earful for this idea, but I'm thinking about buying an em50 and upgrading the power stage myself. I'm no electrical engineer but I've been into this kind of thing since I was a teenager and I have built a couple mosfet SMPS circuits for car audio amplifiers. I know the basics of what will be involved here but I have a couple questions for you guys who may understand these circuits and this controller a little better than I do. Does the controller have an amperage limit that you can't change or can this be changed in the programming software? Let's say my em50 has the capability to handle 200amps electrically, is there anything in the software that will stop me from utilizing it's full potential? I understand that adding mosfets to this controller might not be straightforward because I don't know how much the gate driver circuit can handle. So it may require me to build a gate driver circuit too. Let's say I build a separate output section on it's own board with its own battery connections. Could I use the original output section to drive the gates on my new one? I've never had to use an external gate driver on any of my previous projects and I'm just wondering what is required of the gate driver. Does the gate driver require a special transistor or will the same mosfets I use for the output also be fine for gate drivers?

I would also like some input on my motor selection. Is there anyone out there who has tried both the qs165 and the qs138? Is the 138 worth the extra money? I'm conflicted here because there aren't too many really detailed builds out there with the qs165 but lots with the qs138. At least from what I've been able to find.

Hopefully, I will be working on the frame today or tomorrow and I will have pics of the completed frame soon!

I appreciate any input so don't be afraid to post!
I will use that extra pipe sitting there as an internal sleeve to take some of the strain off the welds. Obviously having a weld joint right in the middle of the frame is not ideal.
That's probably a good idea; I ended up having to insert a reinforcement tube in the main keel of the SB Cruiser trike after a failure some years back; it hasn't had any signs of any impending problems since then.

For wheels I'd like to use bicycle rims with moped tires.
Your only choice on that one I'm aware of is 20" (406) rims with 16" tires. Use doublewall aluminum rims, doesn't matter if they're for rim brakes or not in your case, either works. Get ones with eyelets for the nipples if possible.

I use the Shinko SR714 16"x2.25, and would go up to the x3" if I had the space in my wheel wells (have to rebuild the frame to do that...maybe someday).

I recommend using 14/15g butted spokes for best results; if you absolutely have to use bigger ones for some reason, 13/14 butted is the largest I would go to. Sapim or Sapim Strong are good. This is what I have used on my heavy heavy-cargo SB Cruiser trike for years, and the spokes have survived damaged rims and broken axles, etc., even after having been reused (usually a no-no) on more than one wheel build.

You'll probably need to order spoke head washers with your spokes to keep them from pulling thru the probably-large moped (drum brake?) hub holes.

If for some reason you have to use spokes large enough for moped rims, you'll need to actually use moped rims, so the much higher tension they require won't damage the rim (which leads to deforming or cracking the rim around the holes which loosens the spokes which then leaves the rim unsupported and this can spiral into a collapsed wheel).

You almost certainly won't find any steel suspension forks that are worth having. :( (I haven't)

If you don't need suspension you can build some good ones the way I did, using the clamps off whatever dual-crown fork you run across, and good cromoly bicycle frame tubing (doubled up internally in my case, using parts from old Trek frames IIRC), and weld on whatever dropouts and caliper mounts you like.

If you need suspension, you can remove the dropouts from a straight-tube stanchion fork, and find a tube of the right ID to slip over your stanchions, slit it partway along it's upper length, and weld nuts to either side of the slit in a couple of places. Then weld your dropouts and mounts to the tube. Slip the tube over the stanchions, and run a bolt thru the nuts to clamp the tube to the stanchions.

I plan to water cool the motor and electronics and possibly my battery pack. I have obtained this small water pump, buck converter and a PC water cooling heat exchanger.
Watercooling the battery can be technically challenging; if anything goes wrong with the cooling system that leaves any water-based fluid in there it'll destroy any cells it gets onto/into from corrosion. Other fluids you'd have to test to see what would happen. There have been some builds doing this over the years, with some info in their threads.

If you can build a battery that is more than capable of supplying all the current needed without pushing the cells anywhere near their limits, it will perform much better (less voltage sag so more watts to your wheel) and won't heat up to need any cooling.

If the motor is desgined to be watercooled (some are) it is simple enough to do; if not you can do it the way you describe if it is an inrunner, since the stator will be on the outside against the casing. If it's an outrunner, the part you need to cool is in the core of the motor and to have the watercooling do the best job you'll need to do some careful modification to install cooling tubes in the stator in the right places without damaging windings (there are a number of threads testing out this sort of thing for assorted motors).

Watercooling controllers is easier--you just make a heatsink block to bolt to (or in place of) the existing heatsink plate, with the waterpath built into the block (threads on that, too, or follow the same ideas as the computer-cpu/etc cooler blocks). The PC cooling blocks are generally not going to be the right shape or size, and if you're not cooling the FETs reasonably evenly, the resistances of different ones in different parts of the bridges will be different under various heating conditions, and uneven current will flow in them, which may cause some to fail if they're being pushed hard enough to need the cooling in the first place.

The buck converter is supposed to be good for 96v and 10amps which should be more than enough for the pump.
The pump in the image is 12v, so using 96v on it is likely to destroy it from the excess current / heat it will generate, and it may mechanically fail from the several-times-higher RPM than normal.

The heat exchanger may end up being too small but I'll start from here. It was less than $20 and should fit nicely on the bottom of the battery
If possible, I'd put it as far from the battery as you can, so as not to introduce more heat into the battery, unless you will have insulation between them. (insulation will prevent heat from exiting the battery in that area, though, so those cells will remain warmer than the others).

Votols have a number of threads here with info on them and the problems people have run into, which should help you decide which one to use (or not). Their software (like most of them) leaves a lot to be desired; there's plenty of discussion about various aspects of the various versions of that, too.

Keep in mind that most of these controllers are rated pretty near their actual component limits, which is bad engineering practice, so if you are pushing them enough that you have to modify them to make them do what you want, failures are more likely than otherwise (and failures are common enough even just with normal usages that go near those limits).

There are a number of controller design threads that discuss and work out gate drive, FET choice, board layouts, etc., which is probably useful info for you to have if modifying a controller this extensively.

You may also want to look into the Lebowski brain board threads, since that is designed to use a separate powerstage (some of us have put them onto large-EV (car, etc) powerstages (found cheaply enough as used parts) to run our motors (mine haven't been finished yet, but others have already done the exact same work successfully).
Thanks for the input! I was not aware that I could use washers for the spoke heads on the hub. That sounds like a better idea than drilling out the holes in the rim. I definitely want front suspension so I'll have to figure something out for that. Maybe I can get my hands on two sets of fork tubes that already have a mount for a brake caliper and just use two of one side. As far as the buck converter goes, I meant that it accepts 96v and outputs 10 amps at whatever voltage you set it to. So it should power the 12v pump without getting too hot hopefully. That's a good point about cooling the mosfets. I hadn't considered that. I was thinking about using several separate water blocks with feed lines from the pump on each one with returns back to the reservoir so that they all get cool water instead of water that has been heated by the others first. I was planning to do it that way just to cool them better but I hadn't considered the fact that they would otherwise have different resistances. The radiator mounting will be something I do later on. I may I'll look into this Lebowski thing you speak of. It sounds like exactly what I want. I like the idea of having a separate output board because the mounting could be more flexible. Especially helpful if I'm going to water cool it. Plus, I could potentially upgrade it in the future if I decide it's not enough initially. Good tips! Much appreciated!

I didn't make it to the garage today unfortunately so no work on the frame. I have this all in a friend's garage about 40 miles away and I have no car so I have to rely on other people for transportation. I have a ride lined up tomorrow though! Fun fun!
I got to work on my frame today. Initially I was just going to lengthen it but once I got to that point I decided to extend the rear of it as well. I'm trying to end up with something like 20-24" between the seat and the pedals without making it too tall. It ended up working out pretty well I think and with the way I did this I retained the same spacing between the shock mounts. It welded up pretty well and I love having a real MIG.
The gray one already had the headset tube(I'm not too familiar with the technical terms of a bike frame. I learned bikes by taking them apart and building Frankenstein bikes as a kid) sawzalled off so I cut the front part off the black one and used a piece of tubing with the OD matching the ID of the frame tubing as an inner sleeve to reduce the direct stress on the weld. This tubing is pretty thick so this may not have been necessary but it gives me peace of mind and it also helped keep things aligned without making some kind of jig.
I cut a slot like this into each frame section to weld them directly to the sleeve. I didnt have any drill bits available to do plug welds.
This was where my original plan ended but I started brainstorming how I will do the crank and where the pedals will end up and I just didn't think they would be in a good spot no matter how I did it. So I decided to extend the swingarm mount downward using the remaining part of the black frame.
I cut the seat bracket off so that I can move it a few inches upward and forward to keep it in a good would have been too far down had I left it in its original location.

This is where I ended up when I quit for the day. I don't think the neighbors were appreciating all the grinding and I was getting tired of it myself. I'll head over there next weekend to finish removing the remnants of the various brackets and such that I cut off and to re attach the seat support/bracket whatever you want to call it. I'll be making some kind of seat myself. My sister wants to do the upholstery work for it
Thanks for the link! I was trying to search for a certain size washer earlier and I think I was just making things more complicated for myself. Only 2 replies and I'm already glad I posted here!
Well I didn't make it over to work on the bike this week but some new parts have arrived. I got the front and rear rims and tires, the moped hub for the rear, the extended pit bike swingarm and some other various bits. I haven't ordered spokes as of yet. I didn't trust the online measurements I got so I wanted to have the stuff in hand first. Still waiting for the front hub as it's coming from china. I will be ordering the spokes for the rear and the spoke washers on payday.

Front rim and tire

S&M mainline 22" BMX tire

We the people logic 22" rim
It really is 28mm too

Mitas mc-2 3.25-16

Stranger Crux xl 20" rim

Extended pit bike swingarm

12.5" nitrogen charged shock with adjustable spring perch

Schrader valve to refill reservoir.

Peugeot 103 36h "Leleu" style rear hub. 80mm drum with 12mm axle and 18t freewheel. The axle for the pit bike swingarm is 15mm so I replaced the bearings to make it fit on the 15mm axle. Still have to drill out that brake plate for 15mm and get some spacers to make it all fit together properly.

Old axle bearing on the left newer larger one on the right

Polyurethane chain guide/idler

56t rear 420 chain sprocket for Peugeot moped. Some Puch sprockets have the same bolt pattern but with less offset. I chose the one with more offset since I have plenty of room. That should give me more flexibility with the motor mounting I think.

I'm considering using a jackshaft because most of the similar commercial designs do but according to my calculations a 10 tooth on the motor with this 56tooth on the back should land me at about 60mph at around 4500rpm. The peak rpm rating for the motor is 5000rpm. I don't really plan on going that fast so maybe a jack shaft is in order. 10t and 56t is the shortest gearing I can get without custom parts. It would be a lot easier to gear up later on than to try and add in a jackshaft after everything is welded so I'm contemplating this.

I've been looking into this Lebowski brain stuff and it seems like it's right up my alley. There's a lot of work to be done if I want to do it right. I'm really trying to get this thing completed before it snows but the benefits of the Lebowski controller are immense it seems. I definitely want to get in on that. I'm planning on ordering the PIC first and messing around with it to get a good grasp on that and then I'll start prototyping my output stage. If it ends up taking too long I'll just throw a cheap controller on it to hold me over until I finish the Lebowski. I may start another thread to document the controller build to make it easier for people to get info about it. That way they don't have to sift through this thread for the info.

The swingarm is really beefy! I did not expect that at all. It's pretty heavy actually because it's steel. I would trust this thing to take some abuse but I don't know if it suits my purposes being so heavy. I may end up getting an aluminum version in the future. We'll see how it turns out with this one first.

Next on the list is to get the QS165 and start fabbing the motor mounts. Once the motor is in place I will add the pedals in. This way I can be sure I have enough room to put the motor in an ideal location in line with the swingarm pivot(or above if I decide to use the jack shaft).

Things will be coming together soon so stay tuned!
It has a tab in that area but I'm not actually sure what it's for. I'm pretty sure the pit bike it's meant to go onto has a rear drum as will my bike.
Not sure if that's for a disc brake or what. I'll be using it to mount a bracket for the torque arm like device that holds the drum brake plate in place on my moped hub. I think that peg on the opposite side is meant for the pit bike drum brake. The welds really aren't pretty are they? 🙂

Another pic of the brake plate for the Peugeot 103 hub:
It's just cable operated via that lever there. You can pull/push the lever either direction to engage the brake shoes. I actually have the foot pedal from one of the pit bike frames that used to activate the brake. I may or may not use it. Depending on how this Lebowski controller works out I may use a brake lever with a pot for Regen braking on the right hand side of the handlebars and then the foot pedal for the rear brake.
No you're probably right. I don't actually know because I've never had a pit bike before and I'm not so knowledgeable when it comes to them. I've seen some on the net that have disc and some that have drums so I'm not sure. This swingarm is supposed to be universal for all the China pit bikes so it wouldn't surprise me if it had provisions for both disc and drum. All I really know about it is that it's the right size to fit my frame and it has 12" of clearance from the axle to the shock mount. Enough for a 20" bike wheel or a 16" motorcycle wheel. Maybe even a 22"/18" if the tire isn't too tall.

I won't be using disc brakes on the rear because I want to have a sprocket on both sides of the hub like a moped does. I don't see how a disc brake could fit like that. Otherwise I'd definitely go for the discs. Drums aren't all that bad but discs are definitely better.

EDIT: if anyone is curious here are the dimensions as provided to me by the seller
Last edited:
Enough for a 20" bike wheel or a 16" motorcycle wheel. Maybe even a 22"/18" if the tire isn't too tall.
Or a tall tire on the 16"; like a 90/90 or whatever.

I won't be using disc brakes on the rear because I want to have a sprocket on both sides of the hub like a moped does. I don't see how a disc brake could fit like that. Otherwise I'd definitely go for the discs.
There is a setup called a "sprotor" that does this. The catch is that any chain lubrication can end up on the rotor, and that is generally bad for braking, so you have to either use unlubricated chains, or risk loss of braking.
Some small updates. I got the spokes and laced up the wheels. The rear was difficult and I probably should have ordered the spokes 1mm longer. I went with 14g spokes and the spoke head washers worked perfectly. My paranoia about the online ERD specs was unfounded. My measurements came out exactly the same as what I found online. Still, better safe than sorry. I didn't have any spokes to use for measurements so I used zip ties cut to a length I could measure with my caliper and threaded them through the spoke holes. I got forks from aliexpress. They have a rebound adjustment and an air chamber. They also have a lockout that I will not likely make use of. I read a lot of negative things about Chinese forks around the net but I couldn't find any specific horror stories about them snapping or something like that. In all honesty they look strong to me. The triple tree part even looks solid which kind of surprised me. They are a little bit long for the bike but I think it will still work out ok. I also ordered the motor. I chose the water cooled qs138 90h. It comes with a sprocket and it's the hall sensor version. I believe it's a 428 sprocket however. So I will probably not be able to use it since the rear is for a 420 chain. Once I have the motor in hand I'll try to find the right sprocket but if all else fails I'll just weld a 420 sprocket onto the one that comes with the motor. I've been designing a controller based on the Lebowski brain. I haven't ordered any of the components or boards yet. That will be next paycheck. I really like the idea of having a brake lever to control Regen braking. I think that would be so cool. Here are some pics of the parts.


Rear wheel laced. 3 cross pattern.
Front wheel


This is what the bike looks like as of now


One thing I realized when I mocked it up is that my pedal chain is going to be ridiculously long. I'll probably have to use a derailer as a tensioner or something Along those lines. Once I have the motor in hand the fun will really begin.
Here are screenshots from kicad of the boards for the controller.

Lebowski Brain board

Output board

The plan is to use 6 IPTC017N12NM6 mosfets driven by 6 1EDI20N12AF gate drivers. It's kind of hard to explain how the bus bars will be laid out but I'll do the best I can. The board will have cutouts for the drain pins and all but one of the source pins(which you can see on the board in the screenshot). The mosfets will be back to back on opposite sides of the board rotated 180 degrees relative to each other so that the source and drain pins are on opposite ends. The high side on top with its source pins soldered to the low sides drain pins through the cutout in the board. The high side drain pins will be soldered to a piece of copper sheet through the other cutout in the board. I will put kapton tape on that sheet then layer another sheet and solder the source pins of the low side to that sheet. So the copper bus bar sheets will both be on the bottom of the board with a piece hanging off the edge where the caps and battery wires will be soldered. I hope that makes sense. I'm no good with modeling software so I can't really make a nice 3d image of this. The current sensors will have their own board which I have yet to design. I will also use individual isolated power supplies for each gate driver but I haven't worked that part out yet.
The motor arrived today. Qsmotor qs138 90h water cooled version. It has hall sensors and a 428 sprocket. I will have to obtain a 420 sprocket. It weighs about 40lbs! All the covers and the wire exits are sealed with silicone which is a nice touch. It just has the 6 mounting holes on either end without the mounting bracket on the side like the regular qs138 has. I don't have a big enough socket to take off the nut and remove the sprocket to see what kind of shaft it has. The bearings feel nice and tight with no play whatsoever. Seems high quality at first glance. I guess only time will tell.


All I can really say is that it's gigantic
I just watched his Flexi-Bike video, but purposefully and quickly past the thumbnail of the shoe-toss-wheelie video.

Its such a clean motor, its like a piece of artwork. Harnessing that much power
The motor arrived today. Qsmotor qs138 90h water cooled version. It has hall sensors and a 428 sprocket. I will have to obtain a 420 sprocket. It weighs about 40lbs! All the covers and the wire exits are sealed with silicone which is a nice touch. It just has the 6 mounting holes on either end without the mounting bracket on the side like the regular qs138 has. I don't have a big enough socket to take off the nut and remove the sprocket to see what kind of shaft it has. The bearings feel nice and tight with no play whatsoever. Seems high quality at first glance. I guess only time will tell.

The motor looks beautiful 👌
So around 40lbs, what was the exact weight? I would recommend switching to a 520 chain as it’s a lot easier to find rear sprockets. As far as the silicone, QS never puts enough. As long as you’re not riding in too wet of conditions, that shouldn’t be an issue though.

Edit: add silicone to that plastic bushing that the wires are coming through. Water can seep around the outside edges of that bushing as they don’t do a great job of sealing the plastic bushing to the motor.


  • 85BA77E2-A13F-4796-9FE5-368D65E967F3.jpeg
    353.6 KB · Views: 12
  • B0B4D5C4-8D1E-4456-923E-414AE18D14F3.jpeg
    359.7 KB · Views: 12
Last edited:
Thanks for the tip about the sealant. Gives me an excuse to take it apart haha. As if I could resist! It looks like generic silicone sealant anyway. I'd much rather use some automotive grade silicone on it. Im also interested to see how the water jacket is designed. I'm kind of assuming it's open on the ends and the end covers of the motor housing seal it. I have to get the right torx bit so I don't chew the bolts up. The FedEx label says 16kg and the seller's description says approximately 17kg for the weight. Just looking at the length of the motor, I'm thinking I'll pretty much have to use a jackshaft because it will stick too far out to one side if I don't. I wanted to avoid the jackshaft because of the extra complications involved with that setup but it seems like the way to go forward. My biggest concern with it is the noise of the primary chain that has been reported by many. So I will probably use a belt for the primary drive. This motor is available with a pulley so I guess I chose the wrong direction there. I will mock it up to see how it will sit in the frame when I get back to the bike and make my final decision about that. More than likely that will happen this weekend. The more I think about it the more I like the jackshaft concept though. It has some good advantages. I'll be able to tuck the motor up into the curved part of the frame and out of the way of road debris and/or possible obstacles and other things that could possibly come into contact with it. Then, of course, the extra flexibility and options for gearing.

The main reason why Im kind of set on the 420 chain is because of the rear hub I'm using. It's a moped part and the bolt pattern is unique to moped stuff as far as I know. It has six M6 bolts that hold the sprocket to the hub in a triangular pattern. The ID of the sprocket where it seats on the hub is 94mm which is common amongst some sprockets I've seen when searching, however, the bolts are smaller and closer to the edge of the metal than anything else ive been able to find. It seems like simply re-drilling another sprocket would be complicated by this. I suppose I could weld two sprockets together but Im not sure what the best way to keep things concentric would be in that case.

I chose this motor, in the end, because my projects are always never ending. I know that Once I "complete" the bike I'll already be looking for ways to upgrade and improve it and I'm sure a bigger battery will be in order once the initial one wears out. I'll probably go up to 96v on the second battery, So this motor will give me plenty of room for expansion on version 2.0 of the bike. Not to mention, I really will be using this for transportation so reliability of the components I can't easily and cheaply replace is a priority. To me, this seemed like a better investment than the other motors I was considering despite the cost being higher.

I've been having a great time with this project already and I'm not even half way through. The world of electric propulsion has introduced me to a lot of new ideas and concepts. I've been learning a lot and it's been tons of fun planning and researching. I'm hooked for sure.

I watched some of the videos of this "death bike" and it looks awesome! I've been sifting through his posts on here as well. Seeing those videos also reminds me that I need to be mindful of safety. Even though my intentions aren't to be speeding around town and I'll be keeping it under 30mph the majority of the time, I'll definitely be buying a helmet, at the very least. Anything could happen and, at the end of the day, I am by no means an expert fabricator or an engineer. I'm just a guy with a welder, a soldering iron and some crazy ideas. I think this thing is going to be so much fun to ride though.

I'll definitely be posting pics of the inside of this motor here. That way any of you knowledgeable folks who may be wondering how these are actually built can analyze the design for yourselves. I'm certainly curious although I don't know exactly what I'm looking for/what to compare it to. Maybe there will be some improvements I can make to it.

Thanks for the the comments everyone. I always appreciate thoughts and suggestions. Even just interesting ideas whether they're actually practical ones or not. If it makes me or someone reading this think about something, I consider that positive. That's what makes forums like these great!
I got a little bit done on the mount and got a better idea of how the motor is going to sit in the frame. I didn't have a whole lot of time at in my buddy's garage so I didn't get as much done as I would have liked to. I will definitely be using a jackshaft. Without one the motor will stick too far out to the side for my liking. I ordered a 3/4" jackshaft kit and the 22t 8m belt pulley for the motor. I ordered a 40t pulley to put on the jackshaft. Although it will be a little on the large side it will open up my rear sprocket options a little more. I think I will switch to a 520 chain as Eastwood suggested. I will either drill the moped sprocket to allow me to bolt another sprocket to its face or just weld another sprocket to it. I have a good amount of space inside the swingarm to do this. That is of I keep the moped hub at all. Using the jackshaft changes my plans a little bit. I may end up using it for the pedals as well. With a large enough sprocket on the crank I may be able to put the freewheel on the jackshaft and only use one chain to the wheel. I've found some pre-made freewheel adapters with a 3/4" bore and a key that would allow me to use standard freewheels on the jackshaft without modification. If I go that route I'll probably ditch the moped hub since the main reason for using it was for the freewheel. I guess this is what happens when you just wing it. I will probably keep the hub for now since I laced it already and upgrade to a disc brake hub at a later time. This is the first ebike I've ever built so there was bound to be some degree of trial and error. I wasn't able to attempt disassembling the motor in my buddy's garage so I tried once I got back home. It is difficult to get the end caps off with all the silicone. I managed to remove the cover for the hall sensors. I removed all but one of the end covers bolts and nearly stripped the last one on the front cover which put a halt to my attempts. I will be replacing the bolts with higher quality Allen head bolts upon re assembling it. I need to use a puller to remove the front cover because there is really no place to get any leverage since the water jacket is basically flush with the circumference of the end covers. I'm not keen on wedging a screwdriver in between and prying on it because I don't want to damage the edges where the water jacket seals.

This is the beginning of the mounting bracket. I will make pieces like this for both sides and connect them together. The plan is to grind the inside of the hexagon to match the radius of the flange on the motor so it will bolt down flush. I don't want to use spacers because the housing is aluminum. I want to maximize the clamping surface area to reduce stress on the bolt shanks and the holes they thread into in the housing.

And a pic of the hall sensor on the qs138. The clocking seems to be adjustable. I will have to check it with a scope at some point and make the hall signals align with the back EMF of the coils.

The phase wires seem to be aluminum so I'd really like to replace them with copper. Hopefully this can be done without causing any destruction. I saw a video where someone tears a qs138 apart and on his motor the phase wires aren't separate wires. They are the same magnet wire than comprises the coils left long and with insulation over them. That does not appear to be the case with mine. It makes me wonder how they found room inside the housing to make the connections and whether or not the phase wires are actually soldered or just crimped to the coils.
The phase wires seem to be aluminum so I'd really like to replace them with copper.

That's highly doubtful. More likely, they're tinned copper strands. You can gently scrape at them with a razor blade to see if copper appears.

Most aluminum wire in cheap Chinese crap these days has a copper plating. Those look like copper on the surface, and can usually be soldered, but the cut ends look white. The conclusive way to diagnose them is to expose teased-out strands to a flame from a lighter. If they shrivel from the heat, they're aluminum. If they glow without shriveling, they're copper.
Yes, you are correct, they are indeed tinned copper. The strands are very fine so it's difficult to tell but upon closer inspection I see that I was mistaken.
I got some more done on the mounting bracket today and I also got the rear cover off the motor. The front cover is stuck on very tightly. I'll work on that tomorrow and get a pic of that side too. I'm really curious about how this water jacket is designed. Looking at it from the back side it seems like the front side of the water jacket must be open. Looking through the bolt holes directly on either side of the phase wires I can see light on the other side but it seems the others are blind holes.

The water jacket does not extend through the entire housing as you can see. The extra inch or so of length this motor has over the air cooled qs138 is occupied by these connections to the phase wires. I removed the cream colored fiber insulation and underneath that there was a piece of heat shrink tubing which I cut to expose the connection between the yellow phase wire and the coil. It has a copper crimp connector over a solder joint. Other than that everything seems solid in here to me. The coils are tightly bound by a string and the phase wires are zip tied tightly to the coils so they can't move. The bearing seems solid and spins very smoothly with little resistance and no play. The plastic grommet is definitely lacking enough silicone to seal it totally but the phase wires had plenty. The layer of silicone between the housing and end cover was even and totally encompassed the entire mating surface.
IMG_20231118_233156790.jpgas you can see in this pic, the solder does not entirely cover all of the magnet wire. I'm going to remove the crimp connector to see what it looks like underneath then solder it completely. I just don't like the looks of that connection. What is the best way to remove the enamel from magnet wire when dealing with many strands like this? In the past I've used sandpaper or a razor blade but only on one or maybe several strands. How can I remove it all from this many strands? Is there a standard practice here that people use to do this? If I solder it well it shouldn't need that crimp connector. I'll put a new piece of heat shrink tubing on and zip tie it back the way it was then do the same for the other two.
VID_20231118_111049969_exported_1390.jpgVID_20231118_111049969_exported_7943.jpgi don't have the jackshaft yet so I couldn't start welding things to the bike but I have the front part of the bracket completed as well as some of the pieces I will use to connect it to the frame once I figure out where its exact location will need to be. The other end of the bracket will most likely be a half circle to allow the motor to slide in. Once I get the tubes for the pedals in I will figure out how exactly the other side will be braced. For now, my main concern is getting the motor and jack shaft in place so that I can start to mock everything else up. This piece took me a long time to make working with an angle grinder a drill and a MIG welder. It turned out well and it will be strong.