Virtual Cornering in bike training software

The bike training software industry has been historically neglecting the importance of braking and cornering in cycling simulation. IndieVelo is the only software that claims to consider cornering so far, with their own patented RPTR engine (sic). They included it in their efforts to compete with Zwift and MyWoosh in the official virtual cycling events scene. GT Bike V has also joined this club in the latest 0.7.4 version.

The reason for this neglect is simple. Historically, there hasn’t been a way to reduce your speed or steer in these platforms. So, whenever you faced a steep downhill or winding road in your simulator of choice, there was no point in considering real physics. You would go downhill as fast as the virtual speed function outputs based on the terrain and your power, which often meant reaching absurd speeds that would scare the s**t out of you -if not kill you- if you were on a real road.

But now, with steering devices like Elite Sterzo and combined braking and steering like the Zwift Play, there are no more excuses. If your simulation environment allows for it, you should be able to start managing your corners and controlling your speed like in real life.

Reaching a turning point

Good old Isaac Newton taught us with his first law of motion that a moving vehicle tends to keep its momentum if no forces act upon it. When a bicycle enters a turn, the nature of movement will make it go on a straight line, unless we turn the handlebars (forget about leaning for now; let’s keep it simple). Turning the wheel makes static friction enter the scene in the form of a centripetal force that opposes that straight line movement, so the bike changes direction towards the tangent of a turning circle, and keeps turning until we set the bars straight again.

When we tilt the handlebars, we change the front wheel alignment at an angle deviating from the straight path. The steering angle creates a turning angle that lets us know what the radius of the turn will be. The turning angle is not equal to the steering angle because turning wheels have a ‘slip angle’, but we’ll consider them the same (they are very close at low speeds), again, to simplify.

Ideally, we want to match the turning radius with the radius of the curve we are entering on the road, to avoid hitting the ditch, you know. This turning radius can be calculated with the formula:

turn radius = wheel base / Tan(turn angle)

If you’ve read my previous articles about training software, you may be expecting an example here. So, I’m not going to disappoint you like I do with my mom.

Now let me introduce you to our new buddy, Peter S. This dude’s a downhill speed demon, tearing it up in competitions. Today, he’s our guinea pig. Peter is riding his size 56 S-Works Tarmac SL7 bike, with a wheel base (distance between axles) of 991mm, and reaches the first turn on the descent of the Alpe d’Huez, a quite open curve. He can clearly see the exit point. With his ample training and experience he doesn’t have to think it twice, his muscle memory kicks in and turn the handlebars a modest 2 degrees (0.07 radians). Crunching the numbers:

turn radius = 0.991m / Tan( 0.07 ) = 28.3m

There he goes, smoothly cruising through that first wide and easy 28 meter radius turn. It’s just another day in the saddle.

Why do we need to brake anyway?

When an object travels in a circle, like our bike turning, we need that centripetal force we mentioned earlier to keep it on that circular path – it’s like the gravitational glue pulling us toward the center of the action. This force comes from the static lateral friction between the tire and the road when the tire rubber is twisted at an angle, but here’s the catch: if the friction can’t provide the required centripetal force to stay in the circle, we’ll be skidding away from our intended destination.

Centripetal force needed 
Fc = friction coefficient * mass * gravity accel

This static lateral friction of the tire is characterized by a coefficient which varies influenced by factors like rubber compound, pattern, thickness, inflation pressure, and also the road surface and weather conditions. If our simulation accounts for all these parameters we can find a safe maximum speed to take a turn with a given turn radius. Stay with me here, don’t scroll blindly thought these few harmless equations

centripetal acceleration = speed2 / curve radius   (circular movement law)
also
centripetal acceleration = Fc  / mass    (Newton's 2nd law F = mass * acceleration)
so
speed2 / curve radius = Fc / mass
speed2 = friction coefficient * gravity accel * curve radius * mass / mass
Max speed before skidding = √(friction coefficient * gravity accel * curve radius)
End over end = endo

Go faster than that and, well, we’ve all cringed at those “Friday Fails” videos on Pinkbike, right? You lose traction and boom, you ungracefully pull off an ‘endo’ or just slide onto the ground.

It’s interesting to see how your weight is irrelevant here. That’s because even though the more mass, the more centripetal force you need; the more mass the more friction force you provide, so they cancel out.

Peter is requesting my attention again. He’s eyeing the next switchback on Alpe d’Huez and wants to know how fast he can corner this turn. His road bike has expensive slick tires 25mm wide, inflated at 8 bar (120 psi), the road in this turn is concrete and the day is sunny and dry, with a temperature of 30ºC.

The quality of the tire and the heated rubber raises the friction coefficient, so does the dry, warm concrete road. On the other hand, the narrow tires, the high pressure and the lack of a pattern lowers it. Let’s say we end up with a coefficient of 0.7

A switchback has a really small turning radius. This one is just 5 meters. Using the turn radius formula we conclude Peter will need to turn the handlebars 11 degrees to stay on track. Now lets get the maximum speed:

Max speed = SQRT( 0.7 * 9.8 m/s2 * 5 ) = 5.9 m/s

Peter, stick to 21 Km/h (13 Mph), buddy.

Now, plot twist – Alps weather can be unpredictable. Temperature drops, rain starts, road turns wet asphalt, and our friction coefficient takes a hit, plummeting to 0.5. The next switchback? A tighter 3.5 meter radius horse shoe bend.

Max speed = SQRT( 0.5 * 9.8 m/s2 * 3.5 ) = 4.1 m/s

Correct, that’s shy of 15 Km/h (9 Mph). What intuition told you, physics confirmed, and now we know why -and how much- we need to brake before a tight turn!

Victory is just around the corner

I used the word “cornering” in the title of this article, but I haven’t delved into it yet. Don’t worry, I’m not click-baiting you. As we’ve seen, speed, steering angle, and friction all play a role in taking a turn as safely and swiftly as possible. The radius of the curve, though, is a fixed feature of the road and can’t be changed – or can it?

Well, as long as you are free to adjust your position on the road before the turn, you can actually alter the curve radius. We call the racing line the ideal path a cyclist takes through a corner to maintain speed and control. The racing line can vary based on the shape and characteristics of the turn, but it almost always involves opening wide at the entry point, getting as close as possible to the apex, and opening again at the exit point. The result of this maneuver is actually widening the turn radius by creating a broader circle that is tangent to the original curve at the apex point. Bigger radius equals more speed. Even if you don’t know exactly where the apex is because the curve is new to you, you’ll have an approximate idea where it lays when you’ve been cycling -or racing any vehicle- for a number of years.

In a nutshell, cornering is the skill of finding the racing line and adapting your velocity (braking and steering) so you can navigate it at the maximum speed possible without crashing.

How do we apply this to the simulation?

glowy grippy tires?

As we’ve seen so far, there are three linked variables in this equation, steering angle (resulting in a curve radius), bicycle speed, and the static friction coefficient. The latter is not a variable the user can actively control during a ride; it depends on the virtual bike and accessories they choose (I’d love to know what is the static friction coefficient of the ‘Tron’ bike’s wheels in Zwift) and the environmental factors their virtual world can simulate. So we are left with bicycle speed, which can be manually modified if we have a braking device, and steering angle, which can be adjusted if we have a steering device.

When approaching a turn, our biking simulation app can take one or more of these actions:

  1. Automatically reduce the speed to the maximum allowed for the curve radius. The curve radius will be given by the current turning angle.
  2. Limit the maximum steering angle based on the speed. This will make the user crash or veer off the road if they are over-speeding, but will save them from bailing out.
  3. Trigger a skid and bail-out scenario if the user over-steers for their current speed.
  4. Force a speed reduction to a suitable one if their cadence and power drops during or before a turn
  5. Calculate an optimal racing line path to effectively widen the curve radius, guiding the rider to follow that trajectory.
  6. Calculate a sub-optimal racing line path and guide the rider through it if he doesn’t ease off, making him lose time
  7. Apply some braking power to the trainer so it’s harder for the rider to exit the turn if he is over speeding
  8. Punishment approach: Apply some kind of penalty in the gamification if the user over speeds on a turn
  9. Encouragement approach: Award points or rewards in the gamification if the user stays within the speed limit for the turn

The action matrix could look like this:

Steering available / manual steeringSteering not available or auto steering
Braking available2, 3, 7, 8, 93, 5, 6, 7, 8, 9
Braking not available2, 4, 7, 8, 91, 5, 6, 7, 8, 9

Actions #4, #5, #6, #7 and #8 are supported in Indie Velo. GT Bike V has implemented #1, #2, #3, #4 and #7, based on the user’s device setup and riding options. If you engage the auto pilot, you’ll be subject to #1, if you don’t and select obstacle avoidance, you’ll be bound to #2. And if you want the most realistic experience, just turn obstacle avoidance off and you’ll be facing #3 and #4. The static friction coefficient depends not only on the bike you choose, but on the type of surface of the road and on the weather, which GTA V changes dynamically during the game.

If/When Zwift comes to the point of implementing this, I would say they’ll opt for something similar to Indie Velo’s solution, except for the optimal racing line, which is not possible if they stick to just one side of the road like they do now.

The available bike customization can also play a big role in competition and riding fine tuning. Choosing wheel sets with better friction coefficient will help in the turns, but will penalize with increased rolling resistance during the rest of the ride. Choosing the right tires for the weather would become a tactical pre ride decision as well.

What actions and parameters the simulation implements are going to depend on the limitations of the virtual world and what the users of the platform are demanding from your solution: realism and accuracy, fun or competition. Realism may mean the user crashes and has to stop briefly to get back to the bicycle. That may piss some people off. Fun usually means moving away from realism. However, if you aim for competition, having a steering and braking device could give some riders an edge over those without them. Is this a form of Pay-to-Win? Clearly, but not very different from what people do IRL when buying a $15k bike for their amateur summer races, and this is way more accesible.

What is evident is you can’t please everyone at the same time, but at least we made Peter S. happy. Now he has leveled up his understanding of the physics behind his daredevil riding style.


Disclaimer: The model showcased here is a simplification of all the physics involved in turning a wheeled vehicle in motion. It’s been presented like this to make it more informative and implementable in a software simulation solution.

1 thought on “Virtual Cornering in bike training software

  1. Pingback: New version 0.7.4.0 – Virtual gearing, virtual cornering and localization – GTBike V

Comments are closed.