Lean Angle Controller - Two-wheelers

Lean angle profile controller for two wheelers employ a PID control to control the lean of a two-wheeler by applying steering angle.

This controller is used in case of simulating two-wheelers to follow a user provided demand lean profile.

The controller employs a PID algorithm using Demand lean angle as the process variable and the steering angle as the control variable. For more details on the algorithm, please look at the Lean angle profile control section.

The controller block for this controller can be specified as:
DEMAND_SIGNAL = 'DEMAND_LEAN'                                                   
KP = 60                                                              
KI = 80                                                              
KD = 20 

TYPE = 'EXPRESSION'                                                                           
SIGNAL_CHANNEL = 0                                                                     
EXPRESSION = 'STEP(TIME,2.0,0,3.5,25.0D)'
In the above example, the Lean controller is specified using the ‘PID’ tag and providing the constants required for the PID controller. The demand path is specified as expression in the ‘DEMAND_LEAN’ block as a signal that goes from 0 at 2 sec to 25 degrees at 3.5 sec. The demand lean can be specified in other ways as mentioned in Demand Signal for Controllers section.
TAG Attr - string REQUIRED

<PID >

TYPE Attr - string REQUIRED


Specifies objective of the controller.


Specified the block where the user demand signal is provided.

KP Attr - real OPTIONAL

Proportional constant for the PID controller.

If absent, the default value of 60 is assumed.

KI Attr - real OPTIONAL

Integral constant for the PID controller.

If absent, the default value of 80 is assumed.

KD Attr - real OPTIONAL

Derivative constant for the controller.

If absent, the default value of 20 is assumed.

  • The behavior of the controller following a demand lean depends on the values for KP, KI, and KD.
  • If the behavior is not acceptable for a vehicle, the constants need to be tuned.