• Hello ES! We could use some help to get us past the finish line on building the new knowledgebase for the forum.
    Can you donate? Please see our fundraising page. Thank you!

VESC based INNOTRACE motor controller for Bafang M560/510

TPEHAK

🚴‍♂️ Mega poster
Joined
Jun 9, 2023
Messages
885
Location
Twin Peaks
Today is the day guys! Now INNOTRACE belongs to the people! It is like a Christmas miracle!

The PCB and the firmware have been updated.

I recommend to revive the old thread and include this into the first post, but it is up to you how you want to manage it.



The archive with the current versions of the motor controller files (KiCAD version 9.0.0), Gerber files and firmware files can be downloaded here (updated on 2025-12-28).




The firmware source code also can be found here (should be build for luna_m600_Rev5 using the release 6_05).


The latest firmware is "M560 #6 (2025-12-28).bin" (it does not need applying the motor configuration. Just calibrate the rotary encoder and setup the battery if you need to)


Animation scaled.gif
 
Last edited:
Guys, it looks like we nailed it and created the best motor controller ever!

Those few lines of code for asymmetric decay make all the difference and now pedal assist works nice, smooth and predictable. I did not even need to change the coefficients and they worked from the first try as expected. Wheelie control is like a dream! Climbing steep heals is like a dream! Cruising around is like a dream! Offroad is like a dream! It works so well I used all the battery for the today ride!

I also hooked the VESC Express dongle to check the actual temperatures and the M560RS motor stator temperature at the end of the benchmark section was just 55C while the M600 motor with Luna controller was 80C after the end of this benchmark section! The controller temperature was 38C maximum. It is unbelievable, more than 3000W of power and it is not even close to overheating after long tough section at maximum speed!

So I highly recommend you this motor controller and you probably better to pair it with M560RS motor (I guess Bafang did some improvements comparing with regular M560 motor).

1766875942909.png

1766875995119.png

1766876701429.jpeg
 
Last edited:
OK guys, it looks like the one way bearing in my Bafang M560RS is seized. The motor has about 300 miles with this new controller. This motor controller certainly has too much power and brakes things.



Now when I ghost pedal it also drags and rotates the motor. Basically the same issue described here


While it might look like not a big deal because of I do not use it without motor assist the problem is the motor resistance maintains enough resistance force on the torque sensor and the motor starts working before the drive train mechanism parts are completely engaged and as result that slack allows the system to gain some kinetic energy and hit the gear hub mechanism each time I start pedaling which accelerates the wear of the gear hub and destroys it and the gear hub is very expensive unit.

I could increase the torque sensor torque dead band in the firmware to make the torque sensor starting voltage higher so the motor will start working at higher torque sensor torque when the drive train slack is gone, but this sucks.

So is there reinforced one way bearing for M560 motor I can install?

I found a tread with the M560 gears and bearings list


Is this the one caused the motor spins and drag when I spin the crank arms without motor assist?

1769033286821.png
 
Last edited:
Things rapidly got worst. Now the one way bearing is slipping with horrible grinding sound. It can slip even in ECO mode.

Ordered an INA HFL1426-L564 one way bearing on eBay. Will see if it will fix the issue

 
TPEHAK, I'm not sure you are correct in your thinking on this bearing. The HFL1426 bearing is a one way bearing, but is it connected to the pedals directly. I'm sorry but I don't have a motor apart here to confirm what part of the geartrain is activated by the pedal rpm being greater than the torque sensor rpm.

Most one way bearings fail fully unengaged where as you are saying it has drag. My guess is that excess heat on the shaft has melted the internal grease of the bearing and it has dissipated leaving a dry bearing or simply the shaft through heat has expanded taking up the very fine tolerances needed for a one way bearing. A good test would be to simply turn the pedals when the motor is cold and does it have the same drag. If not then its simply heat induced shaft expansion. If it has drag then why has the bearing failed, is it lack of lubrication or genuinely a damaged bearing ?

But that damage can only come from excess pedal pressure and not from the motor ( the motor simply will drive through its gears and not the pedal gear train ). On the TSDZ2 thread there are a number of similar problems but most came down to heat or pedal strikes damaging the bearings within the torque sensor / crank shaft.
 
From the TSDZ2 experience, the one way bearings used came in various quality standards, from memory the standard one was pretty poor quality and failed. I think the thread users eventually found a manufacturer whose bearing with stood over twice the loading of the standard one. You will need to find the manufacturers data sheet before committing to rebuild the motor as if the EBay one has a low max torque then you will quickly be back to square one.
 
The motor has the same drag at any temperature. I know it drags the motor because of it make the motor sound and has inertia you can feel even at no assist. After it started slipping it sometimes works without drag and sometimes with drag, but it does not hold the motor torque anymore. I believe the bearing rollers, or the bearing race or both are damaged.
 
I've now worked out in my head which bearing is at fault. Yes it sounds as though the bearing cage has collapsed either through lack of lubrication or simply its not designed for that amount of loading. From experience of uprating ICE engines for racing purposes taking a motor and then simply increasing the power output, nearly always leads to failure elsewhere. Sometimes you get lucky and other times not, manufacturers are normally pretty accurate in their power calculations and bearing sizes.

So you will need to uprate the spec of that bearing somehow as I don't think modding to take two bearings helps ( different sync timings ), have a look at some of the better bearing manufactuers as some manufactuers bearings will take much more loading than others.

My guess though is that you have melted the internal grease of the bearing and its failed through lack of lubrication. We may have to look at better heat dissipation of the motor somehow. From experience be careful of thinking of cleaning the bearing out and filling it with higher temp grease, it often leads to the bearing not working, its designed to work at a certain viscosity.
 
Last edited:
Opened the motor. The motor decoupling overrun clutch HFL1426 is shattered

1769289798437.png

1769289860553.png

1769289902826.png
 
In looks like it is possible to adopt a larger 16x26x22mm one way bearing with higher torque rate



But that requires some machining work.

The gear bore should be enlarged to 22mm diameter for press fit 22mm outside diameter bearing shell.

The inner race can be fabricated from a case hardened precision ground 16mm outside diameter hollow shaft (the inside diameter should be enlarged to 14 mm for press fit to the gear shaft and trimmed to length)

 
Last edited:
In looks like it is possible to adopt a larger 16x26x22mm one way bearing with higher torque rate



But that requires some machining work.

The gear bore should be enlarged to 22mm diameter for press fit 22mm outside diameter bearing shell.

The inner race can be fabricated from a case hardened precision ground 16mm outside diameter hollow shaft (the inside diameter should be enlarged to 14 mm for press fit to the gear shaft and trimmed to length)

I've already done this =). I haven't had the opportunity to fully test it yet in winter.

If your controller doesn't throw an error when the clutch is locked, you can firmly lock the gears. The original controller, however, throws an error about excess current when pedaling, likely due to the generation.
 

Attachments

  • photo_5300943366981880677_y.jpg
    photo_5300943366981880677_y.jpg
    72.6 KB · Views: 31
  • photo_5300943366981880679_y.jpg
    photo_5300943366981880679_y.jpg
    184.4 KB · Views: 31
  • photo_5300943366981880678_y.jpg
    photo_5300943366981880678_y.jpg
    90.5 KB · Views: 31
The controller works fine with locked clutch. But I would like to avoid using it such way because of now the motor gains some inertia energy before it is engaged with the rear wheel gearhub and hits the gearhub gears each time you start pedaling which might destroy the rear wheel gearhub over time.
 
Last edited:
OK guys, it looks like the one way bearing in my Bafang M560RS is seized. The motor has about 300 miles with this new controller. This motor controller certainly has too much power and brakes things.

I have a suggestion for you.
Very strong low RPM torque = the nightmare of a clutch

For this reason in my mid drives or geared motors, i always run a really pathetic phase amp to battery amp ratio which gimps out the initial torque and in general has the torque curve resembling more like a gasoline engine's.

For example with my lightest.bike mid drive being pushed by a vesc, i have:
40a phase amp
30a batt amp

The gears don't love the burst of torque from mid to high RPM, at some point you will accelerate gear wear, but i have never had a clutch go kaboom

Of course on a DD hub the real limit for phase amps is if you can stay on the bike or not after hitting the throttle. No big concern until we have gears and/or a clutch.
 
@mk00, how hardened was the steel, did you have to grind the diameter or can you simply machine / turn it with a carbide tip ?
The gear just machined with carbide tool, it is not very hard at this place. The inner sleeve are made from bearing steel and installed on a high strength anaerobic retainer.
 
The gear just machined with carbide tool, it is not very hard at this place. The inner sleeve are made from bearing steel and installed on a high strength anaerobic retainer.
That’s good news, relatively easy machining task for those with a lathe or your local machine shop.
 
INA HFL1426-L564 has arrived. Let's hope this is the real one made in Germany and not a Chinese counterfeit. It looks slightly different than the pictures I found in the Internet like here for instance, so who knows what the Chinese guys sent to me.


1770500092536.png

1770500219192.png

1770500249259.png

1770500304220.png

I believe this is the one Luna is talking about here. Will see how it holds the power. That thing is quite expensive, even ordered from China.

 
Last edited:
The new bearing has been installed.

Froze the bearing in a freezer

1770765163576.png

Heated the gear in an oven

1770765251426.png

Pressed the new bearing in

1770765322546.png

Here is the proper spacing and orientation of the bearing for reference if you want to replicate it

1770765415937.png

1770765458779.png
 
OK, installed the motor and took if for a ride. Unfortunately it skips at Sport+ and Boost modes when I press the pedal hard or use throttle at low RPM. It holds OK at Sport mode and below and at higher modes at high RPM. Maybe it is a Chinese knockoff, or maybe the race surface is messed up, or maybe I should not put some grease on it and install it as is without extra lube, or maybe this is the intended torque limit of this bearing, or maybe all together. At least it is not seized now.

Maybe we should try to machine the parts for larger bearing.
 
Last edited:
The additional lube is the problem. When installing, only grease the spindle part with a minimum lube to allow the seal to slide over.

Unfortunately you will have to dissemble the motor and remove the extra grease for that bearing to work. From experience of doing something similar it was almost worth replacing the bearing again as it never really worked as it should have despite washing out the excess, the manufacturers grease and amount is very precise.

Good call with the heating of the gear but not sure it would be necessary.
 
OK, installed the motor and took if for a ride. Unfortunately it skips at Sport+ and Boost modes when I press the pedal hard or use throttle at low RPM. It holds OK at Sport mode and below and at higher modes at high RPM. Maybe it is a Chinese knockoff, or maybe the race surface is messed up, or maybe I should not put some grease on it and install it as is without extra lube, or maybe this is the intended torque limit of this bearing, or maybe all together. At least it is not seized now.

Maybe we should try to machine the parts for larger bearing.
Hello,

From what I've learned you have to press-fit dry, metal on metal.
What kind of noise you have after the replacement when it fails?

Does it require a lot of force to reinstall?

I have something similar on my motor at first i suspected 2nd gear because it sounds like gear slipping it's very loud and sounds like grinding teeth, now I think I have the same issue as you do, I will confirm this when I teardown the motor next week.
 
Last edited:
Yes, dry metal on metal.

When it slips is makes loud creaking noise. It does feel like grinding teeth because of the jerkiness and sound but it is not.

It does require quite a lot of force, so you do need an arbor press tool to extract the old bearing and install the new one.
 
Last edited:
OK, installed the motor and took if for a ride. Unfortunately it skips at Sport+ and Boost modes when I press the pedal hard or use throttle at low RPM. It holds OK at Sport mode and below and at higher modes at high RPM. Maybe it is a Chinese knockoff, or maybe the race surface is messed up, or maybe I should not put some grease on it and install it as is without extra lube, or maybe this is the intended torque limit of this bearing, or maybe all together. At least it is not seized now.

Maybe we should try to machine the parts for larger bearing.
I've replaced clutches many times. In my experience, there's no need to apply any additional lubrication at all. It's even better to replace the entire gear assembly, as damage to the shaft remains.
 
Back
Top