A couple of questions about wiring a 2WD setup and replacing LM317 with XL7015 in controllers

Joined
Jun 5, 2023
Messages
15
Location
Denmark
I want to try making a 2WD ebike with a geared hub on the front and a direct drive hub on the rear. Mainly to get regenerative breaking, maybe a bit more top speed, and still be able to go uphill. Both motors are unknown brands, brought second hand.

My plan is to have two KT36/48 9 amp controllers connected to the same 48 volt battery, with the one for the rear connected up as usual, and the front running without display, tapping of the turn on, brake sensor and PAS signals from the first controller. Both controllers will be running OSEC and the one for the front configured for running without a display. Because they are connected to the same battery, I think it's enough to just tap the three necessary signal wires, and just use the main negative battery wire to connect GND between them. Is that correct?

Poking around with a multimeter, it seems I need the blue wire from the display connector for the turn on signal, the white wire from the display connector for brake signal and the white wire from the PAS connector for the PAS signal. Is that correct?

Anything else I need to do?

While I'm in there, I want to modify the controllers and replace the LM317 regulator with a XL7015 buck converter. I saw this recommended in the OSEC thread, but now that the converters have arrived, I can't find the instructions on how to do it. I'm guessing the input for the XL7015 should come from the side of the power resistor that has the highest voltage, the output to pin 2 of the LM317 and GND from main battery negative. Is that correct?

Thanks for reading and any advice you may have.
 
Sorry, this feels like talking about you while you’re still in the room because I’m not saying it for your benefit, I just have to point out how good your post was. Succinctly stated your objectives, explained your design, described your progress, and requested help with ironing out the wrinkles.

Now for the tough love. It lacked a request for people to challenge the proposal. As unenjoyable as the process may be, throwing a design open to criticism is the best method of improving it.

You’re obviously ok with the additional complexity and points of failure that an unconventional setup involves, having already challenged your own design and overcome your own objections, but I’m not convinced that you’ve entirely put all the doubts to bed.

Your bike will succeed, because of the way you’re going about it. There’s no doubt on that front.

I’ll just ask one question. Would you consider using three motors on a bike? And if not, why not?
 
Thanks. I've tried to find as much information as possible, and just want to make sure I connect everything up correctly. Most posts about this doesn't go into that much detail, but overall the way I want to do it, is pretty much how most other similar 2WD setups are build, if they aren't just "two separate ebikes on one frame" designs. I broke a controller a couple of weeks ago, because I didn't discharge the capacitors before soldering on it. Had a big spark, and now it's in the parts bin. They aren't that expensive, but shipping from AliExpress takes forever, and I want to minimize the risk of breaking another, or even two of them, before new spares arrive, which is why I'm seeking feedback. I also spend a lot of time answering other peoples posts about various subjects, mostly on reddit, but it applies everywhere, and a lot of questions are missing context and information for others to be able to provide good answers. When asking about stuff myself, I like to take a step back and make sure I include all necessary information. Thanks for noticing that.

About using three motors, are you thinking like hub motors on front and back, and a middrive? I don't think there's as much to gain from that, except more weight. Maybe middrive, paired up with a direct drive hub, using the middrive for climbing and the hub motor for speed and breaking, but even that may be a bit excessive, and it's still only two motors. But apparently I just keep on building more and more ebikes. This one is number three, but after completion, the geared rear hub it currently has will be used on a fourth ebike, and as I run out of new things to try out, I might as well build a three motor one at some point. Maybe a cargo trike with motors on all wheels, that would be fun. I'll get back to you in about a year about that xD
 
I'm building a 2wd bike now and one issue that a lot of these builds end up with that I've planned several solutions to is the power and traction balance. In a normal bike there is much more weight on the rear wheel so it has more traction which means if you apply the same torque to both motors the front will spin out before the rear which can make it unstable in any traction limited conditions or with enough power and in fact I've seen many describe bikes with enough power and/or when ridden in low traction conditions as "unrideable. There are a number of possible solutions I see though:

What many do is just use two throttles so they can control the torque to each wheel.

One could simply set the front motor to have less current and dial this is to match how much traction is normally has.

On suitable controllers (I'm using a dual VESC for this reason) you can set the throttle to RPM control (with suitable other limits to make it controllable) and have the controller match the wheel speeds at all times.

Traction control, like the version built in to VESC for this purpose although I'm told it's quite poor at the moment but I think I will be possible to write my own using the VESC scripting if needed.

Mount the battery as far forward as possible to help balance the weight a bit more.

I don't know that this will be an issue with 9A controllers at all though except maybe on ice, loose gravel on pavement or similar traction conditions.
 
The only reason for the fat resistor is drop the voltage to the LM317 so it doesn't explode. ;)

So if your new regulator is intended to run right off your pack voltage and is spec'd to handle higher than the worst-case voltage your system will ever see including regen or charging, then you wire it directly to the KSI / lock / switched battery voltage positive, and main battery negative, inside the controller.

Keep in mind that quite a few counterfeits exist of chips similar to these, which can't take the full voltage range the real ones do.

Regarding the headless controller, remember that it will only have the default power on settings / mode available. If you need it to operate in a different mode than that you'll have to connect the display to it. You can parallel the RX lines of the two controllers, so they both *receive* from the display and run in the same mode with the same settings, but use the TX from only one of them to the display, so the display gets only one set of data to work with and display. (you can put a switch in there to toggle between the two displays if you do need to see what the other controller is telling you sometimes. )
 
About using three motors, are you thinking like hub motors on front and back, and a middrive? I don't think there's as much to gain from that, except more weight. Maybe middrive, paired up with a direct drive hub, using the middrive for climbing and the hub motor for speed and breaking, but even that may be a bit excessive, and it's still only two motors.
Not necessarily, just wanted to check that you’d thought it through, and see whether you’d recognise that many of the conceivable objections to a third motor are equally applicable to a second motor.

And also point out that all ebikes already have at least two motors, with the human body comprising one of them.
But apparently I just keep on building more and more ebikes. This one is number three, but after completion, the geared rear hub it currently has will be used on a fourth ebike, and as I run out of new things to try out, I might as well build a three motor one at some point. Maybe a cargo trike with motors on all wheels, that would be fun. I'll get back to you in about a year about that xD
All good. So long as you’re not unwittingly using two stones to kill one bird because you’re unaware of alternatives, such as left side mid-drives.
 
scaniac: I'm not putting a throttle on it, just setting the front motor to lower current than the rear motor. Traction control would be really cool to have, though.

amberwolf: Sounds good. The buck converter should handle up to 70 or 100 volts, but you make a good point about counterfeit and low quality parts. I'll put a load on it and let it run for a day before soldering it in the controller. Parallel RX lines and a switch is a good idea. I'll do that too.

glennb: Hey hey hey, wait a minute there. Are you saying I can just add more people to the bike and not have to mess around with all those wires? That's absolutely genius!
 
amberwolf: Sounds good. The buck converter should handle up to 70 or 100 volts

Not according to the specs I see for them on various more-trustworthy seeming sites that google lists, which indicate 80v as a max. I recommend looking up the actual spec sheet for the specific manufacturer's part you are using (if the place you buy from can't guarantee you get a specific manufacturer's part, you might want to buy from a different one).
 
80v as a max.

I think it said 70 volts in the listing and the caps say 100 volt, but either in plenty for a 13S battery. Still going to test it, because I've had too many capacitors on cheap DC converters blow up under load. But it will be nice to get rid of the extra heat the LM317 produces inside the controllers. They get real toasty when running at 48 volts.
 
It was a couple of years ago when I read the KT open source firmware thread, but I only remember people swapping buck converters in for use with >13S packs.

People were alternatively heatsinking the resistor to the case, so I’m sure you also considered that approach … and rejected it, because you’re the kind of maniac who puts multiple motors on a bike and seeks to maximise complexity :)

(I’m just jealous, where I live we’re only permitted one motor on a bike. Arguably a third of a motor, relative to jurisdictions that permit 750W.),

The heat’s no concern if you can shed enough of it. Are you confident that the buck converter is a more robust solution for 13S? I think the sample size of people who’ve done it is too small to draw conclusions from, and that the passive resistor heatsinking approach has appeal. You say yourself that you’ve had converters die.

(And yes, employ human propulsion systems wherever possible. Being carted around in a pedal rickshaw beats ebikes and escooters in every way. Relax in comfort and eat an ice-cream. No parking or theft and vandalism stresses to contend with. Or voltage converters to fail).
 
I'll take that as a compliment :-D By the way, I have the same legal restrictions as you, but try to stay under the radar. My commute consists of small rural roads and I do my best to ride in a sensible way and pay attention to others.

I have battery and controller mounted inside a triangle frame bag, and it doesn't seem to get that hot, but it still seems like a simple way to get at bit better efficiency, especially with two controllers in there. And I just like to tinker and modify stuff. If it works, it's great, and if it fails, I learn.
 
I'm building a 2wd bike now and one issue that a lot of these builds end up with that I've planned several solutions to is the power and traction balance. In a normal bike there is much more weight on the rear wheel so it has more traction which means if you apply the same torque to both motors the front will spin out before the rear which can make it unstable in any traction limited conditions or with enough power and in fact I've seen many describe bikes with enough power and/or when ridden in low traction conditions as "unrideable. There are a number of possible solutions I see though:

What many do is just use two throttles so they can control the torque to each wheel.

One could simply set the front motor to have less current and dial this is to match how much traction is normally has.

On suitable controllers (I'm using a dual VESC for this reason) you can set the throttle to RPM control (with suitable other limits to make it controllable) and have the controller match the wheel speeds at all times.

Traction control, like the version built in to VESC for this purpose although I'm told it's quite poor at the moment but I think I will be possible to write my own using the VESC scripting if needed.

Mount the battery as far forward as possible to help balance the weight a bit more.

I don't know that this will be an issue with 9A controllers at all though except maybe on ice, loose gravel on pavement or similar traction conditions.
My chinese 2WD's rear controller had a "torque problem" which turned out to be an intentional solution to what you were describing. It had a "soft start", in which it gives a few gentle pushes before proceeding with a gradient that eventually puts it at full power. They said its a safety feature. They eventually got a custom-programmed controller sent to me with a "hard start", allowing me to start at full power.
 
So having ridden my 2WD bike a few times, it's not totally done so it has a test battery that isn't nearly up for the power levels but still is putting out several KW, I've been very impressed with how well it works. And specifically the VESC traction control system seems to work great, it just reduces power to whichever wheel starts spinning faster to match their speeds. The front doesn't spin out when it has less traction which helps climb steep hills (lots of rear weight transfer) in deep snow. 5in of fresh snow in what most mountain bikers would consider semi-technical MTB trails and it was just unstoppable.

I don't know if the traction control would be enough if traction was very low like on ice with no studs but on ice with studs it's OK, not super stable but I was doing full power pulls and some of that is the ice I was testing on is very bumpy and the bike has no suspension, it's really designed for snow where the lack of suspension isn't an issue.

Now I just need to build this 9KW output pack and see how much power she can really put down.
 
Back
Top