Ultra Tuning: Decoding the Torque Tab's SPD Table

smorgasbord

Well-Known Member
Region
USA
This will be 2 Posts: One on the decoding procedure and results, and then a starter post on how to tune based on the revolutionary new discovery. I predict (and hope!) that this thread will get quite long as people re-evaluate their own tunings in light of the new information presented here, and make new, improved, tunings.

Part 1:
The Bafang Ultra motor has been around since at least 2017, maybe even earlier. Yet, what has been published to date by everyone about the Torque Tab is, to be blunt, flat-out wrong.

How could this be? Well, it starts with Bafang extending the Basic/Pedal/Throttle interface for their previous set of hub motors (BBS01, BBS02 and BBSHD) to add a new tab for the Ultra. Then, while a bunch of reverse engineering went into figuring out how the Basic, Pedal, and Throttle tabs worked for the cadence-sensing BBS01 and BBS02, almost none has gone into the Ultra - at least none that has been reported on the internet. Compounding the problem is that it seems people just assumed things in the existing tabs were the same, when in fact the Ultra motor with its torque sensor is quite different than its predecessors. Whatever the reasons, the fact remains that incorrect advice has been given by everyone - hackers and even by bicycle OEMs - on tuning this motor.

How did I find this out? (Or, more bluntly, how can I be sure of myself?) Here's the long story long:

My wife and I have had our Ultra-powered bikes for a few years now. I read all the guides and played around with tuning, but frankly, I mostly saw limited change and hardly any improvement except for the PAS levels. Promises of torque-controlled, "smooth" powering, etc. were all empty promises in my experience. Then a couple months ago a sharp-edged wiring grommet caused a short-circuit that fried the controller board. That led me to getting an Ultra professionally repaired, which as a result was set back to the default controller settings. And so I was looking at redoing the prior mods and pondering, again, why these mods weren't delivering the promised results. I came across a post on another eBike forum by @ProphetZarquon, which helped me to understand how the Delta Voltage section works, but the Spd Table portion was still very much a mystery to me. Then, Zarquon claimed something about the Spd table that was not just different from what everyone has posted, it was actively contradicted by one of the early Ultra tuners. I asked him about that contradiction, and he suggested I test it to prove it to myself.

And so I did. But, the results surprised both of us!

If you've done Ultra tuning in the past, you might be familiar with the Torque tab. If you're using the pretty commonly available Windows software, it looks like this:
Luna-Torque.jpg


I use an EggRider (which I highly recommend), so the layout is different, but the fields are the same. The top section is the Delta Voltage table. I have previously described how that works and have suggestions on how to set it up here.

Now some of how the Spd Table works is pretty straightforward. When you press on the pedals, the Ultra's torque sensor outputs a voltage based on the force being applied. The Delta Voltage table specifies how that voltage is converted to a Kg, and that Kg number is used by the Spd Table's Start, Full, and Return parameters to return what I call a Percentage of Current (POC) as determined by the MinCur, MaxCur, and KeepCur parameters to be sent down the controller pipeline. It's mostly pretty straightforward:
  • The rider-applied pedal force is converted into the POC using a linear mapping: Start(Kg) produces MinCur(%) while Full(Kg) produces MaxCur(%). Values between Start and Full result in values appropriately between MinCur and MaxCur.
  • That POC is multiplied by the current PAS level's "Limit Current(%)" (specified on the Basic tab), which is then multiplied by the "LimitedCurrent(A)" [really Current Limit, in Amps], which is also specified on the Basic tab, to arrive at an actual Current value, in amps
  • That Current essentially controls the power output of the Ultra motor (Volts * Amps = Watts, a unit of power)
OK, so far so good, but the obvious question is: from which columns are the Start/Full/Return/MinCur/MaxCur/KeerCur values gotten? What do the different SpdXX columns represent? Just about everyone says that the columns represent a percentage of the Ultra's maximum applied pedal cadence (or motor speed since there's a fixed 1:18 ratio in the Ultra). So, for instance, Spd40 would present parameter values when the pedal cadence is about 40% of the Ultra's max assistable cadence rpm (documented as between 135rpm and 185 rpm depending on the battery voltage available (52V would be about 150rpm, btw).

The Prophet told me that was wrong. I decided to find out for myself. Even if it was indeed cadence related as everyone else said, I wanted to get a feel for what pedal rpms mapped to which columns to help me decide what settings were best for me.

I started by devising a set of Spd Table values to isolate what was happening. Essentially, I made MinCur=0 and MaxCur=1 for all Spd table columns except one (Spd40). That way I'd get motor assist only when that column was active. I found that Spd40 was the easiest to safely test on flat roads, and I set MinCur at 50% and MaxCur at 100% there so the power on would be noticeable. With a low PAS level for controller safety (to limit the max amps that could possibly be sent to the motor), I'd ride out in the lowest gear I have (50 tooth rear cog) from a stand still up to as fast as I could pedal, trying to note when power came on and went off. Then I'd repeat the test in the highest gear (10 tooth rear cog) and note the difference in when the power came on. I could use the display's KPH readout as a proxy since the 5X cadence to bike speed difference in the two extreme gears should show up easily there.

So I rode out in bottom gear, and power ramped up starting at about 6 KPH, going away at about 13.5 KPH. It was a ramp-up, ramp-down effect, which was nice. Then I rode out in top gear down the same stretch of road. If the gurus were correct, the power should have ramped-up at about 30 KPH (18-19MPH) (since bike speed in top gear would be 5X bottom gear at the same pedal cadence).

Well, damn if the power didn't ramp-up at the same 6 KPH, and down at the same 13.5KPH! WTF!?!?
OK, so repeat the test and get the same results.

Hmm, I edit the Torque tab to make Spd20, and then Spd60 the only active column and sure enough, it didn't matter how fast I was turning the pedals, the power-up/power-down moments came at the same bike speed within each SpdXX range.

@ProphetZarquon believed the XX in SpdXX were a percentage of the specified Pedal Tab's Speed Limit (either directly via a number or vectored to the display's Speed Limit setting), but my testing found no difference in SPDXX column engagement by changing those Speed Limit values. I have video I can share.

But, then it got even weirder! To see if it really was bike speed related I changed the Wheel Diameter in the Basic tab since that would change the bike speed calculation (number of wheel sensor pings per unit of of time multiplied by wheel circumference). But yet again, the SpdXX colums ramp-up/ramp-down points were at the same KPH!

So, it wasn't actual bike speed that was in control, it was Wheel RPM. I confirmed this by setting the number of Wheel magnets in the Basic tab to 2, even though I still only had 1. Now my Display's KPH was wrong, so I used a GPS speed app on my phone, but sure enough now the ramp-up for Spd40 was at 12 KPH and ramp-down at about 27 KPH - both about double the previous setting's results. With the Ultra thinking it took 2 magnet pings to get a single wheel revolution, I had to go twice as quickly to get the same engagement results.

This is astounding. It's taken 6-7 years to finally figure out what the SpdXX columns represent in the Bafang Ultra's Torque Table. They represent Wheel RPM.

By running my single column isolation test 6 times to cover all 6 SpdXX columns I was able to reverse engineer the values:
SpdXXIn KPHOut KPH
Spd00.014.5
Spd2028.5
Spd40613.5
Spd601018
Spd801625
Spd10020> 40 (never stopped)

Now, these values are approximate. First, the purview of the columns overlap as you can see in the results above. I mentioned earlier that with just one column actionable the power would ramp up as the bike speed entered the KPH range and ramp down as the bike speed exited the KPH range. I believe this is an intentional feathering so that if you have wildly different values in adjacent columns the motor's reaction won't be abrupt, but will feather/ramp/scale between the two columns' values. Nice. Second, I'm riding and looking/recording the display, and there are lags all over the place. When does the display report applied motor power? How quickly do the KPH values update? What's the screen refresh rate on my iPhone (about 40 fps, btw)? I don't have access to a stationary bike trainer with integrated power output, but that combined with some controllable/repeatable motor to drive the Ultra's crankshaft would be a more scientific way to approach this. Third, I had a slightly (10%-ish) incorrect Wheel Circumference in my Display.

To conclude Part 1, since the real deal is Wheel RPM and not Bike Speed, those bike speed numbers should be converted into Wheel RPM (just math):

Here's what the controller activates on:
SpdXXIn Wheel RPMOut Wheel RPM
Spd00.0110
Spd204.520
Spd4013.530
Spd6022.540
Spd803656
Spd10045? - No limit, presumably

The Out Wheel RPM seems pretty linear at 10, 20, 30, 40, but then 55/56.

And again, multiple disclaimers on the above:
  • My Display's Wheel Circumference was about 10% off
  • The KPH On/Off speed from which these were calculated were based on watching the Display
  • Even recoding the display for later playback doesn't help much with accuracy, due to display KPH update lag, screen fps (Frames per second), etc.
  • I did round the numbers off and didn't perform enough runs to get a statistical average.
And now onto Part 2....
 
Last edited:
Part 2:

The real fun begins!
With our Torque Tab Turning World turned completely upside down, being dependent on bike speed/wheel rpm, and not pedal cadence nor motor rpm, how does that affect how we think about what values to specify? I don't have the answers yet. Here are some thoughts:
  • The KPH/MPH ranges are quite low for on paved road use, with the top range starting at only 12.5 MPH. For many on-road riders, that means they'll blow through the first 5 columns pretty quickly and do most of their riding in SPD100.
  • Since we don't have any SpdXX parameters that key off of pedal cadence, we're just going to have to assume that we're in an appropriate gear for the conditions and road speed, and design our Spd table for those speed and hill appropriate gears.
  • Getting the Delta Voltage table right is extremely important to get a good "feel" from the Ultra. The previously claimed "Smooth" settings get most of whatever benefit they do provide from a progressive skewing of the Delta Voltage table, yet the posting on it doesn't talk enough about how those setting were arrived at, nor how one should think about tweaking them.
  • Spd0 is the "start from a stand-still" settings.
  • Spd20 is the "barely moving to ramping up speed" settings.
  • Spd100 is the "flying at maximum speed "settings for flat or downhill roads.
On the first point above: With the KPH ranges being low for on road biking, I decided to fool my Ultra into thinking I was going at half speed. I did this via the SpdMeterSignal setting on the Basic tab (and note the use of "Spd" for Speed here as well as in the Torque Tab - maybe an intentional clue as the interface uses "Speed" for road speed in the Pedal tab). By setting this to "2" when I only have 1 sensor, the Ultra thinks the wheel is rotating half as quickly as it really is. Now, would mess up the KPH/MPH display reading, but I'm using an EggRider and so am able to manually set my Wheel Circumference to twice the actual wheel circumference. Viola! Now MY Spd Ranges are: 0-9 KPH, 4-17KPH, 12-27KPH, 20-36KPH, 32-50KPH, Over 40KPH. See first post in this thread for the default speed ranges.

This doubling trick is more suitable for how I ride, and my display KPH/MPH remains correct. Those riding off-road, on trails may find the original values better suited for them. And note that most displays only let you set Wheel Diameter (not circumference directly), and limit you to 30 inches. I did see that some versions of the 860c display let you specify Wheel Circumference directly, but the max value there is 255cm, which is too small for a double. There might be some path using actual multiple magnets and fake values for diameter and magnets that yield a similar bump in Spd Bike Speed ranges, but I haven't explored those yet (I like my EggRider, but my wife wants a real built-in display).

I'm hesitant to post my current Spd Table values for two reasons:
  1. Most people aren't using an EggRider and so can't double the Spd effective speed ranges
  2. I'm not done decoding all the parameters in the table. (more on this later)
At any rate, here are the relevant values I'm using now. These are for on-road, double-fake-magnet use only. Do NOT use these if you're not doubling the display or if you haven't yet set up your Delta Voltage table.

ParameterSpd0Spd20Spd40Spd60Spd80Spd100
Bike Speed Range0 - 9 KPH
0 - 5.5 MPH
4 - 17 KPH
2.5 - 10.5 MPH
12 - 27 KPH
7.5 - 17 MPH
20 - 36 KPH
12.5 - 22 MPH
32 - 50 KPH
20 - 31 MPH
> 40KPH
> 25 MPH
Start (kg)13118421
Full (kg)405060603520
MinCur (%)1357912
MaxCur (%)100100100100100100

Here's my rationale:
  • At low bike speeds you don't want light pressing on the pedals to give much, if any, assistance - that would make the bike less controllable at low speeds. But, as the bike speeds rise you eventually get to the point where you want almost any pressure as an indication that you want more power/go faster. Hence values for Start decrease as bike speed goes up.
  • For Spd0, you want any ramp up in pedal pressure to get you going from a stand-still. Hence, reducing the Full value to a low-ish number lets you apply medium pedal pressure to get full power. But, and this is important, you need to have your Delta Voltage table setup with the proper Base Voltage and then if this feels jerky/abrupt to you, you'll want a progressive, non-linear ramp, as described in this thread. By now I hope you're getting the important of the Delta Voltage table.
  • For Spd100, any pedal pressure at all means you want more power to go faster. So, not only a low Start threshold but a low max pedal pressure since you're in top gear and you don't want motor power to be limited by your ability to apply pedal pressure while at a high pedal cadence.
  • Spd80 is similar to Spd100, but allow for more pedal pressure modulation by the rider to vary the motor output. This is done by increasing the Full threshold.
  • For Spd40 and Spd60 I'm assuming the rider is in an appropriate gear and can control the application of pedal pressure from nothing up to the Ultra's max recognition of 60. If you can't get to 60kg of pedal pressure, then I still recommend keeping the 60 for Full and instead adjusting your Delta Voltage table (by now you know where to look) to accommodate the pressure range you can apply. Keeping the 60 value here enables less granularization in torque sensor, which is better.
  • I personally think one should be able to reach maximum power at any bike speed, and so have MaxCur set to 100 across the board.
  • I set Spd20 as a mix of Spd0 and Spd40 values. This is still a low bike speed. Basically, from a stand-still you start in Spd0, but almost immediately are into Spd20.
Again, I'll repeat that if you're not on-road, or have not setup the double-fake-magnet thing, you don't want to use the above table values. Re-interpret for your bike speeds.


Turns out there will be a Part 3 post, but I'll probably do that in another thread. I haven't talked about Return and KeepCur values, nor CurDecy (StartDegree is probably always 1). The rules for KeepCur in the Spd Table are exactly inverse those of Keep Current in the Pedal tab. @ProphetZarquon assumes this is from a Bafang firmware bug (I confirmed it was the motor controller firmware and not the Windows App that was enforcing restrictions), but it also could be an indication that the values work differently in the different tabs.

Which brings up the whole Pedal tab for Ultra motor thing. This is definitely it's own thread someday. The Pedal tab has been thoroughly researched for the BBS01/02/HD cadence only analog bike retrofit motors, not the torque-sensing purpose built Ultra. There are several values on the Pedal tab that would seem to conflict/overlap with the Torque tab:
Pedal TabTorque Tab
Start Current(%)MinCur(%)
Keep Current(%)KeepCur(%)
Current Decay(1-8)CurDecy
Startup Dgree (Signal No.)StarDegree
Stop Decay(x10ms)?

In addition the "Slow-Start Mode(1-8)" and "Work Mode(angular Speed of pedal/wheel*10)" parameters on the Pedal tab may not affect the Ultra at all, or just not affect it the same way. I don't know of anyone who has tested these Pedal tab parameters on an Ultra motor - or at least published results of that testing on the internet. The BBS motors use cadence to increase power and so need other parameters to get power to be applied when getting going from a stand-still. At any rate, decoding the Pedal Tab for Ultra Motors may require a stationary trainer and power meter, which I don't have. Anyone wanting to contribute to Ultra knowledge - send me a DM!
 
Last edited:
Smorg
Very nice and makes sense to me, what little I know.
I am still following along and learning.............. and waiting for part 2.

ALSO, this View attachment 150155, (PART 1) does not show anything on my end,
Thank you for your time and trouble,

You keep this up and I'll have my new Uart 620 siting in the middle of the floor
so I can hook it ALL UP and tune it etc.
Don
 
Last edited:
Hi Smorg
Part 2 is getting better and better,
Would you think having 2 to 4 magnets would offer better more precise information for the wheel speed?
I read one of the sites that the poster used 2 magnets and received better accuracy,
during he tests.
I like the slow speeds, just what the Dr ordered for rock crawling on rough trails.
What was the gearing you are testing? That info would also be useful, to all of us.
Thank you,
Don
 
Would you think having 2 to 4 magnets would offer better more precise information for the wheel speed?
I read one of the sites that the poster used 2 magnets and received better accuracy,
during he tests.
What he said about that was:
This greatly improves speedo responsiveness as well as assist to remove some lag in PAS start up procedure.
I do believe the first part of that statement, as reported speed on the display is determined by the display receiving sensor magnet pings, doing some kind of count per time unit, and then the math with Wheel Circumference to compute MPH/KPH. So, having more magnets means more pings which should help responsiveness.

But, as for "lag in PAS start up procedure," I think he's speculating here. All of Bafang's motors, whether the cadence-sensing BBS retrofit motors or the torque-sensing built into the frame motors, have an internal hall sensor on the motor with some number of steps. For the BBS motors there are 24 steps in a full revolution, but the max value for the Pedal Tab's "Startup Dgree" is 20. This is different than the wheel magnet and external sensor.

I haven't done a test with the Ultra, but I wouldn't be surprised if it provided power before the first wheel magnet passes by the sensor. If not, you might find yourself in situations where bike startup from stand-still would mean 2 meters of travel without power. If forced to guess, I'd speculate that the motor provides power when the cranks turn enough, where enough is defined by the Torque Tab's "StarDegree" or even the Pedal Tab's "Startup Dgree(Signal No.). For the BBSXX motors, the Pedal Tab's Startup Dgree (which is the number of Hall Sensor Steps) has to be 2 or greater. I don't know if anyone's actually tested that even on the BBSXX motors to see if setting it to 20 would mean you wouldn't get power until the wheel rotated 300 degrees. And I know of no-one who has tested that on the Ultra to see if it matters at all.
 
Ran a few dozen more SPD column isolation tests today:
  • Confirmed that SPD engagement & disengagement is independent of Basic Tab's "Wheel Size" (tried 16-in and 29-in). Note that for the EggRider changing this parameter did not affect the accuracy of the Speedometer readout.
  • Confirmed that SPD engagement & disengagement is independent of EggRider's Display Setting "Wheel Circumference" (used GPS app since that parameter changes Speedometer accuracy).
  • Confirmed that SPD engagement & disengagement is independent of OnRoad or OffRoad mode.
  • Confirmed that SPD engagement & disengagement is dependent on number of Basic Tab's "Speed Meter Signal"s.
    • When I increased from 1 to 2, engagement road speeds (actual) doubled. Checked with GPS, but doubling EggRider's Wheel Circumference compensated for doubling Speed Meter Signal with only 1 actual magnet.
  • Noticed that at SPD0, I can get full power before the speedometer registers something greater than 0. This might be an artifact of the non-zero "O Speed Boost Time" parameter.
I have screen recording videos of most of my test runs that include showing the settings pages and then the actual runs. If I get bored on a rainy day, I might string them together into a proof video.
 
Ran a few dozen more SPD column isolation tests today:
  • Confirmed that SPD engagement & disengagement is independent of Basic Tab's "Wheel Size" (tried 16-in and 29-in). Note that for the EggRider changing this parameter did not affect the accuracy of the Speedometer readout.
  • Confirmed that SPD engagement & disengagement is independent of EggRider's Display Setting "Wheel Circumference" (used GPS app since that parameter changes Speedometer accuracy).
  • Confirmed that SPD engagement & disengagement is independent of OnRoad or OffRoad mode.
  • Confirmed that SPD engagement & disengagement is dependenton number of Basic Tab's "Speed Meter Signal"s.
    • When I increased from 1 to 2, engagement road speeds (actual) doubled. Checked with GPS, but doubling EggRider's Wheel Circumference compensated for doubling Speed Meter Signal with only 1 actual magnet.
  • Noticed that at SPD0, I can get full power before the speedometer registers something greater than 0. This might be an artifact of the non-zero "O Speed Boost Time" parameter.
I have screen recording videos of most of my test runs that include showing the settings pages and then the actual runs. If I get bored on a rainy day, I might string them together into a proof video.
Thanks Smorg
I added this page in my note book.
 
I have it done once a year for peace of mind. Monte Capro will be one year of ownership on 7 June but I had it bled last February a week after the Bulls.
Honestly fresh fluid makes no difference in braking performance. But it's one my requirement for fine tuned ebike.
I even refresh my Stan's sealants every 6 months.
You're a maintenancaholic!
I change my pads when I see the rotors glowing 🙃
 
Back